Skip to content

Commit 9751d1a

Browse files
authored
fix(ce-code-review): restate model override at dispatch point (#681)
1 parent e806522 commit 9751d1a

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

plugins/compound-engineering/skills/ce-code-review/SKILL.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ Pass the resulting path list to the `project-standards` persona inside a `<stand
402402

403403
Three reviewers inherit the session model with no override: `ce-correctness-reviewer`, `ce-security-reviewer`, and `ce-adversarial-reviewer`. These perform the highest-stakes analysis — logic bugs, security vulnerabilities, adversarial failure scenarios — and should run at whatever capability level the user has configured. If the user is on Opus, these get Opus.
404404

405-
All other persona sub-agents and CE agents use the platform's mid-tier model to reduce cost and latency. In Claude Code, pass `model: "sonnet"` in the Agent tool call. On other platforms, use the equivalent mid-tier (e.g., `gpt-5.4-mini` in Codex as of April 2026). If the platform has no model override mechanism or the available model names are unknown, omit the model parameter and let agents inherit the default -- a working review on the parent model is better than a broken dispatch from an unrecognized model name.
405+
All other persona sub-agents and CE agents use the platform's mid-tier model to reduce cost and latency. See the Spawning subsection below for the exact dispatch-time override — the imperative lives there so it lands at the point of action when spawning many agents in parallel.
406406

407407
The orchestrator (this skill) also inherits the session model; it handles intent discovery, reviewer selection, finding merge/dedup, and synthesis -- tasks that benefit from the same reasoning capability the user configured.
408408

@@ -423,6 +423,8 @@ Pass `{run_id}` to every persona sub-agent so they can write their full analysis
423423

424424
Omit the `mode` parameter when dispatching sub-agents so the user's configured permission settings apply. Do not pass `mode: "auto"`.
425425

426+
**Model override at dispatch time.** Pass the platform's mid-tier model on every dispatch except `ce-correctness-reviewer`, `ce-security-reviewer`, and `ce-adversarial-reviewer`, which inherit the session model (per the Model tiering subsection above). In Claude Code, add `model: "sonnet"` to the `Agent` tool call. In Codex, pass the equivalent mid-tier on `spawn_agent` (e.g., `gpt-5.4-mini` as of April 2026). In Pi, pass the equivalent on `subagent` via the `pi-subagents` extension. On platforms where the dispatch primitive has no model-override parameter or the available model names are unknown, omit the override — a working review on the parent model beats a broken dispatch on an unrecognized name. Check this on every Agent / `spawn_agent` / `subagent` call in the parallel dispatch; omitting it on Opus sessions silently 3-4x's the cost of a review.
427+
426428
Spawn each selected persona reviewer as a parallel sub-agent using the subagent template included below. Each persona sub-agent receives:
427429

428430
1. Their persona file content (identity, failure modes, calibration, suppress conditions)

tests/review-skill-contract.test.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,31 @@ describe("ce-code-review contract", () => {
283283
expect(template).toMatch(/Do not default to `gated_auto` when the fix is mechanical/i)
284284
})
285285

286+
test("Stage 4 spawning restates model-override imperative at point of action", async () => {
287+
const content = await readRepoFile("plugins/compound-engineering/skills/ce-code-review/SKILL.md")
288+
289+
// Model tiering subsection still enumerates the three session-model exceptions
290+
expect(content).toMatch(/ce-correctness-reviewer.*ce-security-reviewer.*ce-adversarial-reviewer/s)
291+
292+
// Imperative lives inside the Spawning subsection, not only in the rationale block.
293+
// Extract the Spawning subsection and assert the model-override directive appears there
294+
// with cross-platform dispatch primitives named at the call site.
295+
const spawningMatch = content.match(/#### Spawning\n([\s\S]*?)(?=\n####|\n### )/)
296+
expect(spawningMatch).not.toBeNull()
297+
const spawning = spawningMatch![1]
298+
299+
expect(spawning).toMatch(/Model override at dispatch time/)
300+
expect(spawning).toContain('model: "sonnet"')
301+
expect(spawning).toContain("Agent")
302+
expect(spawning).toContain("spawn_agent")
303+
expect(spawning).toContain("subagent")
304+
// Exceptions are restated at point of action so the agent does not have to recall them
305+
// from the Model tiering subsection above during a 12-agent parallel dispatch.
306+
expect(spawning).toContain("ce-correctness-reviewer")
307+
expect(spawning).toContain("ce-security-reviewer")
308+
expect(spawning).toContain("ce-adversarial-reviewer")
309+
})
310+
286311
test("Stage 5 synthesis uses anchor gate and one-anchor promotion", async () => {
287312
const content = await readRepoFile("plugins/compound-engineering/skills/ce-code-review/SKILL.md")
288313

0 commit comments

Comments
 (0)