You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(delegation): defer activeModel Thinking validation to Adapter open - #1220
Explicit --thinking values for non-default models on active-model-scoped catalogs (Devin, CodeBuddy) are now validated after the model switch instead of being rejected up front. Invalid values still surface as INVALID_ARGUMENT, and the changed paths have targeted test coverage. No concrete merge-blocking risk was identified.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
Applicability reference: AGENTS.md: # Repository Guidelines `npm start` / `npm start web` rebuild and relaunch the user's Desktop / Web and may restart the shared Host; `npm stop` stops all local codexhost services across worktrees.
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
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.
Summary
Devin 与 CodeBuddy/WorkBuddy 的 ACP
configOptions只返回当前激活模型的thought_level选项,其余模型在inspect()目录里省略supportedThinkingOptionIds。此前委派预检(resolveDelegationConfiguration)把缺失的supportedThinkingOptionIds一律按空数组处理,导致显式传--model <非默认模型> --thinking <档位>在调用adapter.open()前即以validThinkingOptionIds: []被拒绝,而对应的 Adapter(DevinAdapter.open()、CodeBuddySession.initialize())原本就已支持先切换模型、再按目标模型真实返回的thought_level校验并应用思考档位。本 PR 最小化收口为四处改动:
@codexhost/shared-contracts):在harnessModelCatalogSchema新增向后兼容的可选字段thinkingOptionsScope: z.enum(["catalog", "activeModel"]).optional()(省略默认为"catalog",既有 Adapter、第三方插件与测试零改动)。devin、codebuddy):在仅观测当前激活模型thought_level的 ACP 目录上标thinkingOptionsScope: "activeModel"(同时覆盖复用 CodeBuddy 配置构建的 WorkBuddy)。@codexhost/host-runtime):thinkingOptionsScope: "activeModel"且目标模型在目录中省略supportedThinkingOptionIds时,对调用方显式传入的--thinking放行交给adapter.open()切换模型后由原生面校验(即使当前激活默认模型本身无thought_level,例如 Devin 默认落在无思考档位的模型时,切往其他支持思考的模型仍可生效);--thinking(未显式传--model)且原生默认模型已确认支持该档位,仍优先回退到原生默认模型;非显式的已保存委派默认思考档位仍按既有规则静默回退;adapter.open()返回的invalidRequest/unsupported映射为INVALID_ARGUMENT,非延后创建路径保持原有DELEGATION_FAILED契约;harness inspect紧凑/文本输出在thinkingOptionsScope === "activeModel"时透出该字段,并同步docs/architecture/delegation-defaults.md。thought_level默认模型起步切换并设置档位、CodeBuddy 目录声明、harness inspect输出以及HarnessDelegationCoordinator延后校验、原生拒绝回滚与兼容回退用例。Related issues
无 / N/A
UI Demo
No visual changes: 仅涉及共享模型目录契约、Devin/CodeBuddy ACP 目录声明与 Host 委派配置预检逻辑,未修改界面。
Test plan
npx tsc -b packages/shared-contracts packages/adapters/devin packages/adapters/codebuddy packages/host-runtime:通过(exit 0)npx tsc -p tests/tsconfig.json --noEmit:全部 12 个改动代码与测试文件 0 报错npx vitest run --config tests/vitest.config.js定向测试(8 个测试文件,共 216 项全部通过):packages/shared-contracts/test/harness-models.test.ts(13/13)packages/adapters/devin/test/thinking.test.ts(30/30)、devin-adapter.test.ts(18/18)、configuration.test.ts(14/14)packages/adapters/codebuddy/test/history-projection.test.ts(42/42)、codebuddy-adapter.test.ts(36/36)packages/host-runtime/test/delegation-cli-output.test.ts(13/13)、harness-delegation-coordinator.test.ts(50/50)npx eslint、npx prettier --check、node tools/check-boundaries.mjs、git diff --check:均通过(exit 0)