Repository navigation
Conversation
One resolver (phase-agent.ts) decides which driver runs each phase; phase-executor, the skills pre-flight, role and ladder resolution, and doctor all read through it. Unknown per-phase agents fail at config resolution with the registry's own message.
…-per-phase-agent-selection-run-phases-phas
…related reformat)
11 tasks
…t role resolution
… .sequant/state.json The 'should skip invalid log files' case called rebuildStateFromLogs without statePath, so every npm test run replaced the working checkout's workflow state with an empty one.
admarble
deleted the
feature/1150-feat-run-per-phase-agent-selection-run-phases-phas
branch
September 25, 2026 20:08
This was referenced Sep 25, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1150
Summary
run.phases.<phase>.agentoverridesrun.agentfor one phase, for examplerun.agent: "codex"withrun.phases.qa.agent: "claude-code".src/lib/workflow/phase-agent.ts(resolvePhaseAgent) is the only place that reads the run-level agent. Every per-phase driver decision goes through it:sequant doctor.buildExecutionConfig, before any worktree is provisioned or any phase runs. The message comes fromassertKnownDriver, whichgetDrivernow also calls, so it's identical to a badrun.agent.role:model resolves against the phase's own agent. The model ladder is also resolved per overriding agent (ExecutionConfig.modelLadderByAgent, omitted when unused), and every per-phase ladder read goes throughladderForPhase. A pin on a phase's own driver's ladder is its starting rung, not an off-ladder pin.role:references and ladder rungs were resolved againstsettings.run.agenteven when--agentoverrode it, so another driver's model was handed to the run's driver. They now resolve against the effective run-level agent. Behavior change:--agent codexwith a claude-code-only string role (for example the defaultmodelRoles, which uses string shorthand) plus arole:model now stops the run at config time with the existing "string shorthand" error. Pinned by two tests inconfig-resolver.model-roles.test.ts; separate Fixed entry in the changelog.QA follow-ups (added after
/qa)src/lib/settings.tsnow has arun.phasesrow (agent/model/effort), and itsagentrow lists codex. Thephasesrow had been missing since feat(run): per-phase model and effort configuration for the claude-code driver #914.state-utils.test.ts› "should skip invalid log files" calledrebuildStateFromLogswithoutstatePath. Everynpm testrun therefore replaced the working checkout's.sequant/state.jsonwith an empty state. It now uses the tempstatePath.state.jsonwas run against each suspect test file on its own.npm test(341 files, 8428 passed), the sentinel issue is still present; before the fix it was wiped.src/mcp/server.test.tsand two MCP integration tests) still rewrite the real state non-destructively. They run a live status reconcile that refreshes titles from GitHub and bumpslastSynced. This is left for a follow-up.AC verification
PhasePolicySchema.agent.settings.phase-policy.test.tschecks the round-trip and that no unknown-key warning appears;config-resolver.phase-policy.test.tschecks the key reachesphasePolicies.config-resolver.phase-policy.test.ts:buildExecutionConfigthrowsUnknown agent driver "…", and the message equalsgetDriver's.skills-preflight.test.ts›1150 AC-2: the realRunOrchestrator.runrejects with that message before any worktree is created, any pre-flight runs or any issue runs.resolveConfigcallsbuildExecutionConfigbeforeensureWorktrees.phase-executor.phase-agent.test.ts: exec runs on the realCodexDriver, qa on the realClaudeCodeDriver. The issue's evidence path was updated fromphase-executor.test.ts, which doesn't mock the registry.grep -rn "config\.agent" src/lib/workflow --include='*.ts' | grep -v "\.test\."prints one line:phase-agent.ts:23, insideresolvePhaseAgent.config-resolver.model-roles.test.tscovers role and ladder resolution per agent, and a failure that names the phase.model-ladder.test.tsshows exec escalating through codex models and qa through claude-code models, and covers the pin rung.skills-preflight.test.ts: an aider run with a claude-code exec requires onlyexec, and a claude-code run with an aider qa doesn't requireqa.phase-executor.phase-agent.test.ts: a codex handle is passed to the codex exec but not to the claude-code qa. This uses the realcanResume.doctor.test.ts:run.phases.exec.agent: "codex"with no codex binary reports the codex check as "configured as agent for phase exec".ready-gate-run.test.tsandphase-executor.test.tspass unedited.docs/reference/run-command.md§ Per-Phase Agent.npm run build,npm run lint,npm run typecheck:scriptspass.timeout 900 npm test: 341 files, 8425 passed, 1 expected fail, 3 skipped.Mutation checks
None of the ACs count as gate tests under
isGateTestEvidence. These were run anyway, and each was restored afterwards:resolvePhaseAgentignoresphasePolicies: 11 tests fail, across AC-3, AC-5 (ladder), AC-6, AC-7 and AC-8.activeDriverinstead ofpolicy.agent ?? activeDriver: the AC-5 role test fails, 1 of 43.assertKnownDriverloop is removed: both AC-2 resolver tests fail (2 of 43), and theRunOrchestratorAC-2 test fails too.agentis removed fromPhasePolicySchema: the AC-1 round-trip test fails, 1 of 28.Pre-PR confidence check
resolvePhaseAgentat each), so a new site that readsconfig.agentdirectly would bypass it. AC-4's grep is the guard against that. The CI GitHub Action (src/lib/ci/) still has its own singleagentinput; that's a Non-Goal.sequant runwith two real drivers, because that needs the codex binary. Dispatch is covered with real driver classes and a stubbedexecutePhase.🤖 Generated with Claude Code