Repository navigation
Conversation
Owner
|
我核对了当前 main 的实现和 D278 / E2E-166:现有约定明确是 因此这不是当前 fix 类 PR 所需修复的回归,我不会按 bug fix 合入这项契约变更。若产品决定调整优先级,请先完成相应的契约/兼容性决策,再以行为变更提请评审。感谢你把兼容性影响、回归覆盖和待决策状态都写清楚。 |
This branch has not been deployed
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.
背景与根因
Related: #286
用户期望:子智能体已经配置主模型和 fallback 时,主智能体不能通过 Task.model 自行改用“允许 AI 调用”的其他模型。
在当前 main
9926e3b73784a3206a9163f5f129c0c9e874afc1核实,buildSubagentTool()明确采用Task.model > definition.model > session model。Task 参数说明也鼓励覆盖默认模型;显式回传父会话 provider/model 同样能绕过子智能体固定模型。现有 fallback 本身已按定义排序,但起点可能在进入 fallback 控制器之前就被覆盖。这是对旧 D278 优先级的有意修订,不声称旧实现违反当时的规格。按请求先提交 Draft,新的 ADR 保持 Proposed,不合并。
修改
model时始终解析该绑定。冲突的 Task.model 被忽略,不查询 AI 模型目录,不调用按需解析;父会话模型回显也不能绕过。ADR subagent-pinned-model-priority并说明兼容性。生产代码只改
packages/agent-runtime/src/runtime.ts,没有修改 UI、数据库 schema、IPC 参数、模型设置或其他贡献者的分支。实际验证
在隔离 GitHub Actions 候选工作树中,使用 Node 24、仓库 pnpm 与 frozen lockfile 安装干净 CI 依赖;模型交互全部指向本地确定性 HTTP/SSE fixture,未使用真实服务商凭据或付费 API。
候选验证 run(全部步骤通过)
测试的代码提交:
ea6bc8c02e124c52b363af6cfc665cb525a398b1上游基线:
9926e3b73784a3206a9163f5f129c0c9e874afc1pnpm --filter @pi-desktop/agent-runtime exec vitest run src/runtime.test.ts src/subagent.test.ts src/subagent-fallback.test.ts src/subagent-definitions.test.ts。包含上述新用例,以及原有 fallback、取消、恢复和授权回归。pnpm test:e2e:subagent-models。驱动构建后的真实 sidecar/NDJSON 和 provider 适配器,捕获本地 HTTP 请求,验证固定模型胜过 opted-in/父模型/按需/未知选择;覆盖首选直接成功、前 1–3 个模型失败后成功、整个链耗尽仍不选择 AI 模型池,并检查 Task 返回及结算的实际模型。pnpm --filter '@pi-desktop/agent-runtime...' build通过(含 shared 与 agent-runtime 的 TypeScript 构建)。pnpm docs:check、pnpm lint、架构检查、git diff --check、pnpm check:pr-base均通过。候选验证使用的临时 workflow/补丁传输文件已在随后提交中删除;最终 PR 差异不包含这些文件,测试过的生产代码、测试和规格字节不变。最终仓库 tree SHA
246696ffcce68998240d8b6490978946d821f731与本地独立编辑结果完全一致。提交 PR 前再次检查 main,behind=0。兼容性及剩余验证