fix(auto-review): 使用专用审核模型链 - #2799
Conversation
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/auto-review-model-router.ts | 新增固定候选链编排器,负责候选超时、有限重试、合法裁决解析、总预算和父级取消。 |
| apps/desktop/src/main/utility-model/oneShotCandidates.ts | 新增 Auto-review 专用候选及受限执行入口,并向通用 HTTP 请求边界传播取消信号。 |
| apps/desktop/src/main/maker-host/auto-permission-reviewer.ts | 支持由内层候选链独占重试,并在 reviewer 截止时间到达时主动取消请求。 |
| apps/desktop/src/main/maker-host/index.ts | Desktop Host 改为使用固定专用路由器,不再按当前会话 provider/model 发起 Auto-review。 |
| apps/desktop/src/main/maker-host/tests/autoReviewModelRouter.test.ts | 覆盖固定候选顺序、解析失败回退、瞬时重试、候选超时和整链取消。 |
| apps/desktop/src/main/utility-model/tests/oneShotCandidates.test.ts | 覆盖 Gateway 隐藏别名、订阅目录约束、凭证刷新取消和无工具 Responses 请求体。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Auto-review 请求] --> B[Cindy Gateway<br/>cindy/auto-review]
B -->|不可用或失败| C[OpenAI<br/>gpt-5.4-nano]
C -->|不可用或失败| D[OpenAI<br/>gpt-5.6-luna]
D -->|不可用或失败| E[Anthropic<br/>claude-haiku-4-5]
B -->|合法裁决| F[返回 allow / block / ask]
C -->|合法裁决| F
D -->|合法裁决| F
E -->|合法裁决| F
E -->|全部失败或总预算耗尽| G[返回 unavailable]
G --> H[现有用户确认流程]
Reviews (3): Last reviewed commit: "test(desktop): 稳定锁接管并行测试" | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 87a21133d7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
Signed-off-by: Chris <4436110+zqchris@users.noreply.github.com>
MagicLizi
left a comment
There was a problem hiding this comment.
审查通过。auto-review 的模型路由从跟随会话模型改为固定候选链,信号/中断生命周期清晰,超时算术正确(12s/候选, 52s 链, 53s 外层),重试门控只允许快速瞬态重试。
|
auto-review 有了自己的模型路由不再受会话模型影响,候选链的超时与重试设计很周到 |
这次改了什么
摘要
Auto-review 不再复用任务当前的 provider/model,而是使用固定的受控候选链:
xd / cindy/auto-review;该服务别名走受限入口,不依赖普通模型目录,也不出现在模型选择器。gpt-5.4-nano→gpt-5.6-luna→claude-haiku-4-5尝试用户已连接且实时目录支持的订阅模型。候选级解析、短暂错误重试、总预算和 AbortSignal 收口在独立编排器中完成;外层 reviewer 不会在超时后重启整条候选链。Responses one-shot 在没有工具时不再发送
tools、tool_choice或parallel_tool_calls。规模构成:实现集中在专用候选编排器和已有 utility HTTP 请求边界;新增代码近半为路由、失败回退和取消行为的回归测试。旧的“按会话模型能力放宽额度”模块与测试已删除。
本实现取代 #2753 中动态猜测 Gateway 模型及第三方会话模型兜底的方案,并包含、扩展 #2689 的无工具 Responses 请求体修复。
变更类型
feat新功能fix缺陷修复refactor/perf重构或性能优化docs/test/chore文档、测试或工程维护范围
ONESHOT_CAPABLE_AGENTS;本地确定性权限规则调整。远程连接 / 手机版适配:SSH 远程任务继续把已有的有界审阅 payload 交给 Desktop Host,不新增本机 workdir 读取;设备互联和手机版作为控制端复用被控 Desktop 的同一 reviewer。本 PR 不新增 IPC、push 事件或移动端入口。
UI 变化
怎么验证的
自动验证
手工验证
不涉及 UI。代码级验证覆盖:固定 Gateway 别名绕过目录、订阅候选顺序、第三方来源隔离、HTTP/空响应/畸形 JSON/超时回退、总预算取消、最终 unavailable 收口,以及无工具 Responses body。
未执行的验证
风险
风险分类
影响与回滚
null,由现有 fail-closed unavailable → 用户确认流程接管。提交前检查
git commit -s,见 DCO)