Skip to content

feat(#914): per-phase model and effort configuration for the claude-code driver - #923

Merged
admarble merged 3 commits into
mainfrom
feature/914-feat-run-per-phase-model-and-effort-configuration-
Aug 9, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/914-feat-run-per-phase-model-and-effort-configuration-

Conversation

@admarble

@admarble admarble commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds run.phases.<phase>.{model,effort} settings and sequant run/sequant ready flags --models/--efforts so a phase can use a different Claude model or reasoning effort than the CLI default (e.g. planning with a stronger model, delegating implementation to a cheaper one).
  • Absent by default: query() options omit both fields entirely until opted in — zero behavior change.
  • One shared resolvePhasePolicies resolver (config-resolver.ts) is called by both buildExecutionConfig (the run path) and ready-gate.ts's buildPhaseConfig (the ready path), so the two producers cannot drift the way the fix(cli): bare parseInt on run --timeout lets a malformed value abort every phase instantly (sibling of #818) #833 phaseTimeout producers once did.
  • Metrics record the resolved per-phase model/effort when set, omitted when inherited. Aider driver is unaffected.

AC Coverage

All 9 ACs MET — see the full QA review on the issue for the detailed table, execution evidence, and adversarial re-read.

Test plan

  • Full test suite: 253 files, 5255 passed, 0 failed
  • npm run build — clean
  • npm run lint — clean
  • Live CLI smoke test: --help shows both flags on run and ready; malformed specs rejected with exit 1 and a clear message; valid specs parse cleanly

Closes #914

🤖 Generated with Claude Code

Seeds the 9 ACs from the /spec plan: settings parsing, the shared
parsePhaseSpec/resolvePhasePolicies resolver, both ExecutionConfig
producers (config-resolver + ready-gate), ClaudeCodeDriver forwarding,
Aider inertness, metrics recording, and the RunOptions live-surface
guard. All stubs verified RED for the right reason (missing export /
unimplemented behavior), not a syntax error.
…ode driver

Adds `run.phases.<phase>.{model,effort}` settings and `sequant run`/`sequant
ready` flags `--models`/`--efforts` so a phase can use a different Claude
model or reasoning effort than the CLI default (e.g. planning with a
stronger model, delegating implementation to a cheaper one). Absent by
default: query() options omit both fields entirely until opted in.

Wiring: config-resolver.ts's parsePhaseSpec/resolvePhasePolicies is the
single resolver both buildExecutionConfig (run) and ready-gate.ts's
buildPhaseConfig (ready) call for CLI > settings > absent precedence, so the
two producers cannot drift the way the #833 phaseTimeout producers did.
phase-executor.ts applies config.phasePolicies[phase] onto
AgentExecutionConfig; claude-code.ts forwards model/effort into query()
options; Aider is unaffected (uses its own AiderSettings.model). Metrics
record the resolved policy per phase when set, omitted when inherited.

Mutation-verified: the AC-3 absence test (query() options contain neither
model nor effort when unset) asserts key-presence via `in`, not truthiness,
and passes today unmodified — confirming it's a live regression gate.
Addresses the 4 gaps noted in QA on #914:

1. phase-executor.ts's connective wiring (config.phasePolicies[phase] ->
   AgentExecutionConfig.model/.effort) had no direct test. Added one by
   driving the real (unexported) executePhase through the public
   executePhaseWithRetry entry point with a mocked driver.

2. run-orchestrator.ts's and metrics-writer.ts's phasePolicies pass-throughs
   were untested. Added a direct test for RunOrchestrator.recordMetrics
   (called via cast, same trade-off as executeOneIssue's existing test) and
   a real-filesystem persist/reread test in metrics-writer.test.ts.

3. --efforts didn't validate against the closed enum at the CLI boundary,
   only at settings-parse time. parsePhaseSpecFlag now accepts an optional
   allowedValues list; --efforts passes settings.ts's new exported
   EFFORT_LEVELS constant (single source of truth for both validation
   points), --models remains unvalidated by design.

4. AC-9 docs lived only in docs/reference/*.md, not the top-level README.
   Added the run.phases settings shape and a link to the Per-Phase Model &
   Effort section directly in README.md's Configuration example.

11 new/updated tests, full suite green (255 files, 5266 passed, 0 failed).
@admarble
admarble merged commit 76fc911 into main Aug 9, 2026
5 checks passed
@admarble
admarble deleted the feature/914-feat-run-per-phase-model-and-effort-configuration- branch August 9, 2026 00:38
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.

feat(run): per-phase model and effort configuration for the claude-code driver

1 participant