fix(#2072): thread resolved model into routed-agent spawns (assumptions-analyzer, code-reviewer, code-fixer)

model_overrides / models.<phaseType> were silently inert for gsd-assumptions-analyzer,
gsd-code-reviewer, and gsd-code-fixer on Claude Code: resolveModelInternal honors them,
but the workflows spawned these agents with no model= param, so the resolved value
never reached the Agent tool and the agents inherited the session model — no warning.

Fix — thread each agent's resolved model at every spawn site (the established
plan-phase pattern; the architecture-consistent Claude mechanism, since 13 other
agents already thread their model):
- discuss-phase-assumptions.md: `resolve-model gsd-assumptions-analyzer --raw`
  → ANALYZER_MODEL, threaded.
- code-review.md + code-review-fix.md (re-review): `resolve-model gsd-code-reviewer --raw`
  → REVIEWER_MODEL, threaded.
- code-review-fix.md (both fixer spawns): `resolve-model gsd-code-fixer --raw`
  → FIXER_MODEL, threaded (same silently-inert bug, same file — folded in per review).
- quick.md review step: was reusing `{executor_model}` for gsd-code-reviewer (so the
  reviewer's own override was ignored); init.quick now resolves `reviewer_model`
  (gsd-code-reviewer) and the spawn threads it.

resolve-model --raw returns the bare model string (resolve-execution --raw would
return effort — wrong). The resolver maps these agents to phaseType discuss /
verification / execution, so models.<phaseType> apply too.

Scope: the three agents reachable from the two issue-named workflows + quick.md. The
wider systemic class (other agents in UNTOUCHED workflows with the same pattern) stays
documented on the issue for a maintainer-scoped structural decision (thread-at-source
vs embed-at-install like #2256), not widened here.

Docs: the stale "discuss — reserved, no subagent today" model-profile tables now list
gsd-assumptions-analyzer and the verification row includes gsd-code-reviewer, across
the English docs, the shipped gsd-core/references/model-profiles.md reference, and the
ja-JP / zh-CN / ko-KR / pt-BR locale mirrors.

Tests:
- tests/model-resolver.test.cjs: #2072 acceptance — model_overrides and
  models.discuss/verification/execution resolve for all three agents.
- tests/model-routing-spawn-threading.test.cjs: every spawn of the three agents threads
  a resolved model (fails pre-fix); a header-precise parity guard fails the suite if a
  new un-threaded spawn of any of them regresses.
All 16 golden-install-parity fixtures + the workflow size baseline regenerated for the
changed shipped files (4 workflows + the reference doc); bin/lib is excluded from parity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-07-07 20:28:15 -04:00
parent cce405c9b7
commit 4483300253
37 changed files with 318 additions and 115 deletions

View File

@@ -128,7 +128,7 @@
"gsd-core/references/loop-hook-dispatch.md": "32e5dfb4dba76987",
"gsd-core/references/mandatory-initial-read.md": "fe59abce693717cf",
"gsd-core/references/model-profile-resolution.md": "f32bb05102839767",
"gsd-core/references/model-profiles.md": "86e81f17c2f23fff",
"gsd-core/references/model-profiles.md": "bd90862f68007f2e",
"gsd-core/references/mvp-concepts.md": "23201c8118fb074a",
"gsd-core/references/phase-argument-parsing.md": "531176f66da49c98",
"gsd-core/references/planner-antipatterns.md": "2459c40bfc8a0ea8",
@@ -241,13 +241,13 @@
"gsd-core/workflows/autonomous.md": "92f08626d4aea668",
"gsd-core/workflows/check-todos.md": "b2b103e8638e760a",
"gsd-core/workflows/cleanup.md": "5d48d64664222a3e",
"gsd-core/workflows/code-review-fix.md": "3ff5f7eac2269ca3",
"gsd-core/workflows/code-review.md": "82858ab037b9176e",
"gsd-core/workflows/code-review-fix.md": "ae7f9c6b39a23c12",
"gsd-core/workflows/code-review.md": "eadada9e0a89adf2",
"gsd-core/workflows/complete-milestone.md": "017df7443bd08da5",
"gsd-core/workflows/debug.md": "cc7b2d2fd4307a78",
"gsd-core/workflows/diagnose-issues.md": "e38bb21d06dff077",
"gsd-core/workflows/discovery-phase.md": "71a4b78ff876a854",
"gsd-core/workflows/discuss-phase-assumptions.md": "f23abfe76623ed63",
"gsd-core/workflows/discuss-phase-assumptions.md": "0d936ec25299917c",
"gsd-core/workflows/discuss-phase-power.md": "3f8b83dc6be2e9d5",
"gsd-core/workflows/discuss-phase.md": "7c9df6656b81fda9",
"gsd-core/workflows/discuss-phase/modes/advisor.md": "db488d74d080c653",
@@ -313,7 +313,7 @@
"gsd-core/workflows/pr-branch.md": "d13e1cc81de40896",
"gsd-core/workflows/profile-user.md": "05828c8cc61ef384",
"gsd-core/workflows/progress.md": "7bedc431bb55edb8",
"gsd-core/workflows/quick.md": "3e7686705da2af19",
"gsd-core/workflows/quick.md": "62b9e138dc70b479",
"gsd-core/workflows/reapply-patches.md": "26297b84736e66a4",
"gsd-core/workflows/remove-phase.md": "9ee0fddd11a0d9d4",
"gsd-core/workflows/remove-workspace.md": "19d7465aaa50cb62",