fix(review): prohibit isolation param in roster output and SKILL.md - #7235
Conversation
A review run passed both working_dir and isolation: "worktree" to every Agent call — they are mutually exclusive, so all 11 agents failed and the review produced nothing. Add a parameter note to the roster header (the last text the orchestrator reads before constructing agent calls) that states the exact working_dir value and explicitly prohibits isolation. Add the same prohibition to SKILL.md as a second line of defense.
|
Thanks for the PR! Template looks good ✓ Problem: this is an observed failure, not a theoretical one — the description names a concrete review run (session Direction: aligned. This is internal review-tooling robustness — clarifying the Agent-tool parameters at the point where the orchestrator constructs its calls. No sensitive area (auth/sandbox/model/telemetry/public contract) is involved. The root-cause read is plausible: the word "isolation" appears descriptively in the skill prompt, which the model can conflate with the Agent tool's Size: the PR touches a core path ( Approach: the scope feels right. Two lines of defense — a reminder in the roster output (the last text read before agent calls) plus an explicit prohibition in SKILL.md — is reasonable defense-in-depth rather than redundancy. One mild observation, not a blocker: the roster note also restates Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:这是一个已观测到的失败,而非理论性问题——描述中给出了一次具体的 review 运行(会话 方向:对齐。这是内部 review 工具的健壮性改进——在编排器构造 agent 调用的位置澄清 Agent 工具参数。不涉及敏感区域(auth/sandbox/model/telemetry/公共契约)。根因分析合理:"isolation" 一词在 skill prompt 中作为描述性词汇出现,模型可能将其与 Agent 工具的 规模:PR 触及核心路径( 方案:范围合理。两道防线——roster 输出中的提示(agent 调用前读到的最后一段文本)加上 SKILL.md 中的显式禁止——是合理的纵深防御,而非冗余。一个非阻塞的小观察:roster 提示还重申了 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
ReviewOverviewAdds a parameter note to the What I verified
Minor observations (non-blocking)
VerdictLGTM. The fix is small, additive, placed at the point of action, and both the failure mode and the prescribed parameters check out against the actual Agent tool validation code. 🤖 Generated with Claude Code — Claude Fable 5 |
Code reviewI wrote my independent proposal first: for "the orchestrator passes both The implementation is clean. The The two new tests are meaningful, not tautological: one asserts the note (with the exact No blockers. Two non-blocking observations: the note also restates Real-scenario testingDrove the actual Counts confirm it: base code → 210-line roster, Unit tests: 中文说明代码审查我先独立写下自己的方案:对于"编排器同时传 实现干净。 两个新测试有意义、非同义反复:一个断言当 无阻塞项。两个非阻塞观察:提示还重申了 真实场景测试在 tmux 中驱动真实的 (终端输出见上方英文代码块。) 计数证实:基线代码 → 210 行 roster, 单元测试: — Qwen Code · qwen3.7-max Reviewed at |
|
Confidence: 4/5 — a small, well-tested fix for a real total-failure mode; the only reservations are non-blocking (a prompt-level mitigation is probabilistic by nature, and the note restates a couple of params beyond the isolation bug). Stepping back: this is exactly the kind of PR that's easy to under-rate because it's small, but it closes a genuine hole — a review run that passed both My independent proposal landed in the same place, so there's no simpler path I think it missed. The code is straightforward — one conditional note reusing the existing The 1/5 reservation I'm holding back from: a model can still pass — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
doudouOUC
left a comment
There was a problem hiding this comment.
Review
Independently reviewed at 1f8cfdab. LGTM — approving.
What I verified against the code (not just the description)
- The mutual-exclusivity claim is real.
packages/core/src/tools/agent/agent.tsreturnsParameters "working_dir" and "isolation" are mutually exclusive.inside theworking_dirvalidation block. That same block also rejectsworking_dir+run_in_background: trueand requires an explicit non-forksubagent_type— so the exact trio the note prescribes (working_dir+subagent_type: "general-purpose"+run_in_background: false, and noisolation) is the one valid combination, not merely "don't pass isolation." - The note can't leak into an agent prompt. It's appended to the header element (index 0),
\n\n-joined ahead of the───── agent k ─────blocks, andrecordPromptruns before the header is composed — so recorded prompts, verbatim-delivery checks, and theprintedBlocks()helper are all untouched. - The guard matches the house pattern.
typeof wt === 'string' && wtis the same shape the role-7 handler uses forworktreePath(typedunknownonPlanReport). - The new tests hit the right branches. The enclosing
beforeEachclears thewriteStdoutLinemock andrunRostercalls it exactly once, socalls[0][0]is safe. The "emits" plan carriesworktreePath+prNumberbut noownerRepo, sorequiredAgentsdoesn't add Agent 0 (gated on both) — the roster is unchanged and nothing throws. - The SKILL.md prose change breaks no test — nothing snapshots the review SKILL.md body; the references that exist are path fixtures or the Agent tool's
isolationbehaviour tests (which corroborate the constraint). - Ran it:
agent-prompt.test.ts→ 142/142 pass;eslint --max-warnings 0on both changed TS files → clean.
Non-blocking (fine as follow-ups)
- The note only rides the Step 3
--rosteroutput; the Step 4 (--findings) and Step 5 (auditor) outputs don't carry it. SKILL.md's "every agent call" prohibition is the backstop there — worth the same one-liner only if the confusion ever recurs at a later step. - On a 17+ agent roster the note sits tens of KB above the last block. Low risk given the orchestrator reads the whole output before constructing calls; repeating it next to
end of rosterwould be the cheap fix if late-agent-only failures ever appear. - The mutual-exclusivity rationale now lives in two places (roster note + SKILL.md) — deliberate defense-in-depth, but the two move together if the Agent tool constraint ever changes.
Small, additive, placed at the point of action, and every claim checks out against the actual validation code. 👍
wenshao
left a comment
There was a problem hiding this comment.
— qwen3.8-max-preview via Qwen Code /review
|
Released in v0.20.1. |
What this PR does
Adds a parameter note to the review roster output that states the exact
working_dirvalue and explicitly prohibits theisolationparameter on review agent calls. Also adds the same prohibition to the review skill prompt (SKILL.md) as a second line of defense.Why it's needed
A real review run (session
6b154e50) passed bothworking_dirandisolation: "worktree"to all 11 review agents. These parameters are mutually exclusive in the Agent tool, so every agent call failed immediately — 3 with a parameter error, 8 killed by loop detection — and the review produced nothing despite ~4 minutes and ~126k tokens of setup work.The root cause is that the skill prompt tells the orchestrator to set
working_dirbut never explicitly prohibitsisolation. The word "isolation" appears descriptively in the prompt ("Worktree isolation: all subsequent steps..."), which the model conflated with the Agent tool'sisolation: "worktree"parameter. The roster output — the last text the orchestrator reads before constructing agent calls — contained no parameter guidance at all.Reviewer Test Plan
How to verify
Run the roster command against a plan with
worktreePathand confirm the header includes the parameter note:Two new tests verify: (1) the note appears when
worktreePathis present, (2) it is absent whenworktreePathis missing. All 142 tests pass.Evidence (Before & After)
N/A — non-UI change (CLI output + skill prompt text).
Tested on
Risk & Scope
Linked Issues
Observed in session
6b154e50-c280-480c-b31a-42cab1d73a87(review of PR #7221).中文说明
这个 PR 做了什么
在 review roster 输出中添加参数提示,明确给出
working_dir的确切值并禁止在 review agent 调用中使用isolation参数。同时在 review skill prompt(SKILL.md)中添加相同的禁止指令作为二级防线。为什么需要
一次真实的 review 运行(会话
6b154e50)在所有 11 个 review agent 调用中同时传了working_dir和isolation: "worktree"。这两个参数在 Agent 工具中互斥,导致所有 agent 调用立即失败——3 个报参数错误,8 个被循环检测杀掉——尽管花了约 4 分钟和约 126k tokens 做准备,review 没有任何产出。根因是 skill prompt 告诉编排器设置
working_dir但从未显式禁止isolation。"isolation" 一词在 prompt 中作为描述性词汇出现("Worktree isolation: all subsequent steps..."),模型将其与 Agent 工具的isolation: "worktree"参数混淆。而 roster 输出——编排器构造 agent 调用前读到的最后一段文本——完全不包含参数指导。风险与范围