fix(pi): 裸模型 id 自动补 settings.defaultProvider - #1003
Open
Barrierml wants to merge 1 commit into
Open
Conversation
Pi 收到 `--model grok-4.6` 时会绕过 settings.json 的 defaultProvider, 在多个已认证 provider 上撞同名 id 直接退出。启动前把裸 slug 写成 `provider/id`;已带斜杠的配置保持原样。
Owner
|
感谢这个 PR!先说结论:方向和定位的 bug 都是对的—— 不过目前"只要是裸 id 就补
所以无条件补前缀会带来两类问题:
建议的收窄改法(保留你修复的赢面、同时灭掉回归):
另有一个次要点供参考: 以上是自动评审的初步意见,可能有疏漏,最终以维护者审阅为准。再次感谢贡献 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
Pi 适配器启动时如果
BotConfig.model是裸 slug(例如grok-4.6),会读~/.pi/agent/settings.json的defaultProvider,把--model写成provider/id。已带/的配置原样透传;没有 defaultProvider 时保持裸 id。为什么
pi --model grok-4.6会绕过 settings 的 defaultProvider。同名 id 同时出现在team-gateway/tako-tiny32k/github-copilot/opencode/xai时,Pi 直接报 ambiguous 并 exit 1。BotMux 大志只配了model=grok-4.6,所以新会话起不来。影响面
adapters/cli/pi.ts+ 新 helperpi-model.tsprovider/id的 bot 行为不变defaultProvider时行为与原来一致测试
412 passed。