Repository navigation
fix(models): follow the recorded CodeBuddy configuration home - #1373
Merged
jeff-r2026 merged 1 commit intoOct 25, 2026
Merged
Conversation
- 使用统一 toolHome 解析 CodeBuddy models.json,使环境变量与机器记录的优先级和其他资源一致,避免模型配置写入无人读取的默认目录。 - 沿用模型所有权与还原机制,保留个人模型和默认目录文件;活动配置移动后拒绝迁移写入,恢复原目录记录后可安全还原。 - 补充环境变量与无变量记录的切换、还原、目录变更回归以及两个真实 CLI 场景;修复前 3 个目录用例失败。 - 81 个模型单测、两个真实 CLI 切换还原用例、构建、类型检查与 lint 通过,更新中英模型配置说明。
|
No findings in the scoped PR diff. The PR description includes sufficient testing: a built-CLI add → switch → restore record for both environment-selected and recorded CodeBuddy homes. This satisfies the real-CLI verification requirement. Review was read-only; I did not run, build, or install PR code. |
49 of 52 tasks
jeff-r2026
approved these changes
Oct 25, 2026
jeff-r2026
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed and verified on latest main (f3cd042) stacked with the other PRs in this batch: tsc / lint / build pass, related unit and E2E tests pass.
Walternater
pushed a commit
to Walternater/teamai-cli
that referenced
this pull request
Nov 2, 2026
- 使用统一 toolHome 解析 CodeBuddy models.json,使环境变量与机器记录的优先级和其他资源一致,避免模型配置写入无人读取的默认目录。 - 沿用模型所有权与还原机制,保留个人模型和默认目录文件;活动配置移动后拒绝迁移写入,恢复原目录记录后可安全还原。 - 补充环境变量与无变量记录的切换、还原、目录变更回归以及两个真实 CLI 场景;修复前 3 个目录用例失败。 - 81 个模型单测、两个真实 CLI 切换还原用例、构建、类型检查与 lint 通过,更新中英模型配置说明。
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.
teamai models switch --agent codebuddyalways writes~/.codebuddy/models.json, even when CodeBuddy's configuration home has moved. The command can report a successful switch while leaving the active catalog unchanged.Resolve CodeBuddy's model catalog through
toolHome('codebuddy'), matching recorded-home precedence and the existing resource paths. Reuse the ownership/restore path guard: personal models survive, an active configuration is not transplanted into a different home, and restoring works after selecting the original home again. Update the descriptor note and bilingual model reference.Refs #1221 (B4 / model settings in moved homes). The independent hook path fix is #1371.
Validation:
npx vitest run src/__tests__/codebuddy-relocated-models.test.ts src/__tests__/model-switch.test.ts— 81 passed. Covers environment and recorded homes, preservation of the default file and personal models, path-change refusal and restore.npx tsc --noEmit,npm run lint,npm run build— passed.npx vitest run --config vitest.e2e.config.ts src/__tests__/e2e/codebuddy-relocated-models.test.ts— 2 passed. Both environment-selected and recorded-without-environment homes survive add → switch → restore; the inactive default catalog is never created.Tool-side contracts: configuration/data environment override and models.json. No model endpoint or live CodeBuddy session was used.