feat: use 1M context model for implement nodes in bundled workflows (#1018)

* feat: use 1M context model for implement nodes in bundled workflows (#1016)

Large codebases fill the 200k context window during implementation, triggering
SDK auto-compaction which loses context detail and slows execution. Setting
claude-opus-4-6[1m] on implementation nodes gives 5x more room before compaction.

Changes:
- Set model: claude-opus-4-6[1m] on implement nodes in 8 bundled workflows
- Fix loop nodes to respect per-node model overrides (previously only used
  workflow-level model)
- Review/classify/report nodes stay on sonnet/haiku for cost efficiency

Fixes #1016

* fix: resolve per-node provider/model overrides for loop nodes

Move provider and model resolution for loop nodes to the call site,
matching the pattern used by command/prompt/bash nodes. This fixes:

- Loop nodes now respect per-node `provider` overrides (previously ignored)
- Model/provider compatibility is validated before execution
- JSDoc on buildLoopNodeOptions accurately describes the function
This commit is contained in:
Rasmus Widing 2026-04-06 21:02:17 +03:00 committed by GitHub
parent 71263d741f
commit 594d5daa2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 40 additions and 5 deletions

View file

@ -115,6 +115,7 @@ nodes:
- id: adversarial-sprint
depends_on: [init-workspace]
idle_timeout: 600000
model: claude-opus-4-6[1m]
loop:
prompt: |
# Adversarial Development — Sprint Loop

View file

@ -8,6 +8,7 @@ description: |
nodes:
- id: implement
command: archon-implement
model: claude-opus-4-6[1m]
- id: create-pr
command: archon-create-pr

View file

@ -133,7 +133,7 @@ nodes:
command: archon-fix-issue
depends_on: [bridge-artifacts]
context: fresh
model: opus
model: claude-opus-4-6[1m]
# ═══════════════════════════════════════════════════════════════
# PHASE 5: VALIDATE

View file

@ -52,6 +52,7 @@ nodes:
command: archon-implement-tasks
depends_on: [confirm-plan]
context: fresh
model: claude-opus-4-6[1m]
# ═══════════════════════════════════════════════════════════════════
# PHASE 4: VALIDATE

View file

@ -415,6 +415,7 @@ nodes:
- id: implement
depends_on: [implement-setup]
idle_timeout: 600000
model: claude-opus-4-6[1m]
loop:
prompt: |
# PIV Loop — Implementation Agent

View file

@ -42,6 +42,7 @@ nodes:
command: archon-implement-tasks
depends_on: [confirm-plan]
context: fresh
model: claude-opus-4-6[1m]
# ═══════════════════════════════════════════════════════════════════
# PHASE 4: VALIDATE

View file

@ -189,6 +189,7 @@ nodes:
- id: implement
depends_on: [validate-prd]
idle_timeout: 600000
model: claude-opus-4-6[1m]
loop:
prompt: |
# Ralph Agent — Autonomous Story Implementation

View file

@ -207,6 +207,7 @@ nodes:
# ═══════════════════════════════════════════════════════════════
- id: execute-refactor
model: claude-opus-4-6[1m]
prompt: |
You are executing a refactoring plan with strict safety guardrails.

View file

@ -1438,8 +1438,8 @@ async function executeBashNode(
}
/**
* Build WorkflowAssistantOptions from workflow-level config.
* Loop nodes use workflow-level provider/model only; per-node overrides are not supported.
* Build WorkflowAssistantOptions from resolved provider, model, and config.
* Caller is responsible for resolving per-node overrides before passing model.
*/
function buildLoopNodeOptions(
provider: 'claude' | 'codex',
@ -2373,6 +2373,34 @@ export async function executeDagWorkflow(
// 3b. Loop node dispatch — manages its own AI sessions and iteration
if (isLoopNode(node)) {
// Resolve per-node provider/model overrides (same logic as other node types)
let loopProvider: 'claude' | 'codex';
if (node.provider) {
loopProvider = node.provider;
} else if (node.model && isClaudeModel(node.model)) {
loopProvider = 'claude';
} else if (node.model) {
loopProvider = 'codex';
} else {
loopProvider = workflowProvider;
}
const loopModel =
node.model ??
(loopProvider === workflowProvider
? workflowModel
: config.assistants[loopProvider]?.model);
if (!isModelCompatible(loopProvider, loopModel)) {
return {
nodeId: node.id,
output: {
state: 'failed' as const,
output: '',
error: `Node '${node.id}': model "${loopModel ?? 'default'}" is not compatible with provider "${loopProvider}"`,
},
};
}
const output = await executeLoopNode(
deps,
platform,
@ -2380,8 +2408,8 @@ export async function executeDagWorkflow(
cwd,
workflowRun,
node,
workflowProvider,
workflowModel,
loopProvider,
loopModel,
artifactsDir,
logDir,
baseBranch,