Skip to content

fix(review): allow ReviewFixer as a review session primary agent - #2127

Merged
bobleer merged 2 commits into
GCWing:mainfrom
YodonTan:fix/review-fixer-session-mode
Aug 7, 2026
Merged

fix(review): allow ReviewFixer as a review session primary agent#2127
bobleer merged 2 commits into
GCWing:mainfrom
YodonTan:fix/review-fixer-session-mode

Conversation

@YodonTan

@YodonTan YodonTan commented Aug 6, 2026

Copy link
Copy Markdown

背景

review 会话可以正常创建并产出 review 结果,但从 review 结果点击「开始修复」时报错:

审核失败
Failed to start dialog turn: Unknown session mode: ReviewFixer

根因

commit ca94825ad 把 external primary agent 解析接入会话创建与 turn 启动路径后,resolve_primary_agent_for_turn 的本地回退白名单只放行了会话创建/首轮使用的 CodeReview / DeepReview。但 review 流程的「修复阶段」由前端以 agentType='ReviewFixer' 提交(DeepReviewActionBar.handleStartFixing → sendMessage(..., 'ReviewFixer', 'agentic')),ReviewFixer 不在白名单(SubAgent 类别,hidden(["CodeReview","DeepReview"])),导致修复轮启动失败。

同一解析函数的全部受影响路径:

  • turn 启动:Failed to start dialog turn: Unknown session mode: ReviewFixer
  • 手动压缩:ReviewFixer 会话压缩同样失败
  • 会话恢复:恢复路径解析失败后会把会话 agent_type 静默改写为 agentic(修复中途重启丢失 ReviewFixer 绑定)

修复

is_builtin_session_primary_agent 白名单加入 REVIEW_FIXER_AGENT_TYPE(常量已存在于 bitfun-agent-runtime::deep_review::constants,经 deep_review_policy 导出),一处修改覆盖 create/turn/restore/compact 全部路径。ReviewFixer 注册为 hidden 且仅允许在 CodeReview/DeepReview 下使用,放行不会暴露给普通会话;ReviewWorker/ReviewJudge 等 team 角色保持受限。

测试

registry 测试扩展:

  • fallback 分支:CodeReview/DeepReview/ReviewFixer 均解析为 Local session primary
  • Local route 分支:三者均解析成功
  • ReviewWorker/ReviewJudge:fallback 与 Local route 下仍返回 None(限制不变)
  • external-owner 守卫:CodeReview/ReviewFixer 在 expected_owner=External 时仍返回 None

34 个 registry 测试全部通过;cargo check -p bitfun-core --no-default-features 通过。

关联:修复 #2124;此前 #2106(修复 #2100)只覆盖了 CodeReview/DeepReview,本 PR 补齐修复阶段。

Tant added 2 commits August 6, 2026 22:59
The remediation phase of a review child session runs with agentType=ReviewFixer (DeepReviewActionBar.handleStartFixing submits it on "Start fixing"). The primary-agent resolution added by ca94825 only allowed CodeReview/DeepReview through, so the fix turn failed with "Failed to start dialog turn: Unknown session mode: ReviewFixer". The same resolution gate also broke manual compaction of ReviewFixer sessions and silently rewrote the session agent_type to agentic during restore.

Add REVIEW_FIXER_AGENT_TYPE to the builtin session-primary whitelist so create, turn, restore, and compaction all resolve identically. ReviewWorker/ReviewJudge stay restricted. Registry tests now cover ReviewFixer through both the no-route fallback and explicit Local routes, plus the unchanged ReviewWorker/ReviewJudge and external-owner guards.
Follow-up from the review pass on the ReviewFixer session-primary fix:

- non_builtin_same_name_review_agent_does_not_resolve_as_session_primary: a non-Builtin entry occupying the builtin ReviewFixer id fails closed instead of inheriting the builtin primary path.
- Extend the external-owner guard to DeepReview alongside CodeReview and ReviewFixer.
- Document in coordinator is_review_agent_type that ReviewFixer is intentionally excluded from review-phase manifest injection (remediation runs outside DeepReview execution policy gates), and record the primary resolution boundary in deep_review/AGENTS.md.
@YodonTan

YodonTan commented Aug 6, 2026

Copy link
Copy Markdown
Author

Ubuntu编译问题我认为和该补丁无关,重跑CI应该就能正常。

@bobleer
bobleer merged commit c4a301e into GCWing:main Aug 7, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants