Skip to content

fix(workflows): add provider: claude to opus[1m] implement nodes#1622

Merged
coleam00 merged 3 commits into
devfrom
archon/task-fix-issue-1610-v2
May 9, 2026
Merged

fix(workflows): add provider: claude to opus[1m] implement nodes#1622
coleam00 merged 3 commits into
devfrom
archon/task-fix-issue-1610-v2

Conversation

@coleam00

@coleam00 coleam00 commented May 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Problem: Three bundled workflows (archon-feature-development, archon-idea-to-pr, archon-plan-to-pr) use model: opus[1m] on their implement nodes but do not set provider: claude. When a user's defaultAssistant is codex, the DAG executor silently routes those nodes to Codex, which ignores opus[1m] and completes in ~3 s with empty output.
  • Why it matters: Downstream nodes receive empty output and the entire workflow produces nothing — with no error surfaced to the user.
  • What changed: Added provider: claude to the three affected implement nodes; regenerated bundled-defaults.generated.ts. Also fixed three pre-existing Windows CI failures (path-separator bug, newline truncation, IS_SANDBOX=1 guard skip).
  • What did not change: dag-executor.ts provider resolution logic is unchanged (explicit annotation is the right fix); the five workflow files that already set provider: claude at the workflow level are untouched.

UX Journey

Before

User (defaultAssistant: codex)    DAG executor              Codex
───────────────────────────────   ────────────              ─────
runs archon-feature-development ─▶ resolves provider
                                   node.provider = undefined
                                   workflowProvider = undefined
                                   → falls back to config.assistant = "codex"
                                   dispatches to Codex ─────▶ receives opus[1m] prompt
                                                              completes in ~3s
                                   node_completed ◀───────── output: ""
                                   create-pr node runs against empty context
User sees: PR created with no implementation

After

User (defaultAssistant: codex)    DAG executor              Claude
───────────────────────────────   ────────────              ──────
runs archon-feature-development ─▶ resolves provider
                                   node.provider = "claude"  [explicit]
                                   dispatches to Claude ────▶ receives opus[1m] prompt
                                                              implements tasks
                                   node_completed ◀───────── output: <implementation>
                                   create-pr node runs with full implementation
User sees: PR created with real implementation

Architecture Diagram

Before

archon-feature-development.yaml
  implement node
    model: opus[1m]
    provider: (none) ──▶ dag-executor resolves: config.assistant ──▶ CodexProvider

After

archon-feature-development.yaml
  implement node
    model: opus[1m]
    [~] provider: claude ──▶ dag-executor resolves: "claude" ──▶ ClaudeProvider

Connection inventory:

From To Status Notes
archon-feature-development implement node dag-executor modified now carries provider: claude
archon-idea-to-pr implement-tasks node dag-executor modified now carries provider: claude
archon-plan-to-pr implement-tasks node dag-executor modified now carries provider: claude
dag-executor ClaudeProvider unchanged resolution path now deterministic
bundled-defaults.generated.ts loader.ts modified regenerated to embed YAML changes

Label Snapshot

  • Risk: risk: low
  • Size: size: S
  • Scope: workflows
  • Module: workflows:bundled-defaults

Change Metadata

  • Change type: bug
  • Primary scope: workflows

Linked Issue

Validation Evidence (required)

bun run validate

All six checks passed:

  • check:bundled

  • check:bundled-skill ✅ (also fixed Windows path-separator bug)

  • type-check ✅ (0 errors across all 10 packages)

  • lint ✅ (0 errors, 0 warnings)

  • format:check

  • test ✅ (0 failures; also fixed 2 pre-existing Windows test failures)

  • Evidence provided: validation.md artifact from workflow run

  • No commands skipped.

Security Impact (required)

  • New permissions/capabilities? No
  • New external network calls? No
  • Secrets/tokens handling changed? No
  • File system access scope changed? No

Compatibility / Migration

  • Backward compatible? Yes — provider: claude was already the effective behavior for users with defaultAssistant: claude (the default). This makes it explicit and safe for all users.
  • Config/env changes? No
  • Database migration needed? No

Human Verification (required)

  • Verified scenarios: provider: claude is present in all three YAML files; bundled-defaults.generated.ts contains the updated YAML strings; bun run validate passes on Windows.
  • Edge cases checked: The five workflow files that already set provider: claude at workflow level are unmodified and unaffected.
  • What was not verified: Live end-to-end run with defaultAssistant: codex against a real repo (no Codex license in test env).

Side Effects / Blast Radius (required)

  • Affected subsystems/workflows: archon-feature-development, archon-idea-to-pr, archon-plan-to-pr — implement nodes now always route to Claude regardless of defaultAssistant.
  • Potential unintended effects: Users who intentionally wanted Codex to handle opus[1m] nodes (unlikely — Codex silently no-ops them) will now route to Claude as intended.
  • Guardrails/monitoring: node_started event now always shows {provider: "claude"} for these nodes — observable in workflow logs.

Rollback Plan (required)

  • Fast rollback: Revert the three provider: claude lines and re-run bun run generate:bundled.
  • Feature flags or config toggles: None.
  • Observable failure symptoms: node_completed with duration_ms < 5000 and node_output: "" on an implement node — same pattern as the original bug report.

Risks and Mitigations

  • Risk: A user running archon-feature-development with defaultAssistant: codex and no Claude binary configured would now get a Claude provider error instead of silent empty output.
    • Mitigation: This is the correct behavior — explicit failure is better than silent empty output. The error message will tell the user to configure Claude. The previous behavior (silent no-op) was strictly worse.

Summary by CodeRabbit

  • Documentation

    • Added clarification that provider selection is independent of model configuration.
  • Chores

    • Updated workflow configurations to explicitly specify provider settings.
    • Fixed Windows path handling for consistent build behavior.
  • Tests

    • Enhanced test coverage for provider routing behavior and workflow validation.

Review Change Stack

Without an explicit `provider:` annotation, the DAG executor falls back to
`config.assistant` (default: `codex` for some users). Codex silently ignores
`opus[1m]`, completes in ~3 s with empty output, and downstream nodes receive
nothing. The three bundled workflow files that pair `model: opus[1m]` with no
`provider:` are now annotated with `provider: claude`.

Also fixes three pre-existing Windows CI issues: path-separator bug in
`check-bundled-skill.ts` (backslash vs forward slash), newline truncation in
`dag-executor.test.ts` script-failure test, and `IS_SANDBOX=1` guard skip in
`provider.test.ts` root-UID test. Regenerates `bundled-defaults.generated.ts`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41414a96-4a98-4bef-ad36-4623b1a74920

📥 Commits

Reviewing files that changed from the base of the PR and between f4f2725 and d03785f.

📒 Files selected for processing (10)
  • .archon/workflows/defaults/archon-feature-development.yaml
  • .archon/workflows/defaults/archon-idea-to-pr.yaml
  • .archon/workflows/defaults/archon-plan-to-pr.yaml
  • packages/cli/src/cli.ts
  • packages/docs-web/src/content/docs/guides/authoring-workflows.md
  • packages/providers/src/claude/provider.test.ts
  • packages/workflows/src/dag-executor.test.ts
  • packages/workflows/src/dag-executor.ts
  • packages/workflows/src/defaults/bundled-defaults.generated.ts
  • scripts/check-bundled-skill.ts

📝 Walkthrough

Walkthrough

This PR enforces explicit provider routing for opus-model workflow nodes by declaring provider: claude in bundled workflow defaults. Provider routing tests verify behavior, and documentation clarifies that provider selection is independent of model strings. Includes test maintenance and minor refactoring.

Changes

Provider Routing Fix for Opus Models

Layer / File(s) Summary
Bundled Workflow Provider Configuration
.archon/workflows/defaults/archon-feature-development.yaml, archon-idea-to-pr.yaml, archon-plan-to-pr.yaml
Three bundled workflow YAML files now explicitly declare provider: claude for nodes using opus models: implement in archon-feature-development and implement-tasks in both archon-idea-to-pr and archon-plan-to-pr.
Provider Routing Verification Tests
packages/workflows/src/dag-executor.test.ts
New regression test suite for #1610 verifies nodes without explicit provider inherit workflow-level defaults (codex) even with model overrides, and explicit provider: 'claude' overrides defaults. Invariant test ensures all opus-model nodes in bundled defaults have provider: 'claude' at node or workflow level.
Test Maintenance & Fixes
packages/workflows/src/dag-executor.test.ts, packages/providers/src/claude/provider.test.ts
Claude provider root-permission test explicitly clears process.env.IS_SANDBOX to reliably trigger the root guard and restore it in a finally block. Script failure regression test adjusted to use block-comment padding.
Provider Selection Documentation
packages/docs-web/src/content/docs/guides/authoring-workflows.md
Clarifies that provider selection is independent of the model string: nodes without explicit provider: route to the configured defaultAssistant regardless of model value.
Code Maintenance & Refactoring
packages/cli/src/cli.ts, packages/workflows/src/dag-executor.ts, scripts/check-bundled-skill.ts
CLI isVersionRequest refactored to use args.some(...). Comment in substituteNodeOutputRefs clarified. Windows path normalization added to bundled-skill check script.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • coleam00/Archon#1610: The changes directly address this issue by explicitly declaring provider: claude for opus-model nodes, fixing the provider inference bug where opus[1m] was incorrectly routed to Codex.

Possibly related PRs

  • coleam00/Archon#1395: Both PRs modify the same workflow node configurations in the bundled defaults—this PR adds explicit provider: claude while the related PR changes model pins to opus[1m].
  • coleam00/Archon#1461: Both PRs modify the Claude provider test suite in packages/providers/src/claude/provider.test.ts, touching the same code area for provider behavior tests.
  • coleam00/Archon#1263: Both PRs affect the bundled-defaults handling and workflow configuration generation; this PR's added provider: claude entries will affect the generated bundled-defaults output.

Poem

🐰 A hop, skip, and Claude's on the case,
Opus now routes to the right place!
No more Codex confusion here,
Provider routing crystal clear,
Workflows flow with provider care! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch archon/task-fix-issue-1610-v2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coleam00

coleam00 commented May 9, 2026

Copy link
Copy Markdown
Owner Author

🔍 Comprehensive PR Review

PR: #1622 — fix(workflows): add provider: claude to opus[1m] implement nodes
Reviewed by: code-review, docs-impact, pr-test-analyzer agents
Date: 2026-05-09


Verdict: ✅ APPROVE

The fix is correct, complete, and safe. The 3 YAML annotations are on exactly the right nodes, the generated file is consistent, the Windows CI regressions are resolved, and all CLAUDE.md rules pass. No blocking issues found across any review dimension.

Severity Count
🔴 CRITICAL 0
🟠 HIGH 0
🟡 MEDIUM 2
🟢 LOW 3

✅ What's Good

  • Surgical YAML fix: provider: claude placed at node level (not workflow level) — minimal correct scope, preserves any future workflow-level override
  • try/finally in provider.test.ts: Correctly restores IS_SANDBOX env var even on test failure — prevents state leak
  • Windows path separator fix: .replace(/\/g, '/') is a no-op on Linux/macOS and correct on Windows — idiomatic and safe
  • Block-comment newline fix: '/* p */'.repeat(500) avoids Windows execFile argv truncation at newline boundaries
  • settingSources regression guard: New test explicitly locks the settingSources: ['project'] contract — any future refactor that silently widens scope will fail this test
  • Generated file consistency: Only 3 YAML entries changed in bundled-defaults.generated.ts, exactly matching the 3 modified workflow files
  • No changes to dag-executor.ts or registry.ts: Correctly excluded per scope
  • CLAUDE.md compliance: All 9 checked rules pass ✅

🟡 Medium Issues (Suggested Follow-ups — Non-Blocking)

1. No regression test for the core bug scenario (criticality: 8/10)

📍 packages/workflows/src/dag-executor.test.ts

No test verifies the provider resolution fallthrough: node with model: opus[1m] + no provider: + workflowProvider = 'codex' → routes to Codex. A future YAML edit or new workflow could silently re-introduce this.

Suggested test
it('routes node to config.assistant when node has no provider annotation', async () => {
  // Sets up a node with model: opus[1m] but no provider:
  // Passes workflowProvider = 'codex' (simulating defaultAssistant: codex)
  // Asserts getAgentProvider was called with 'codex', not 'claude'
  // Then with provider: 'claude' on the node, asserts it routes to 'claude'
});

Recommendation: Create a follow-up issue — out of scope for this targeted fix.


2. No semantic assertion for bundled YAML opus[*] nodes (criticality: 6/10)

📍 packages/workflows/src/ (new test)

check:bundled verifies structural consistency but doesn't parse YAML content to assert provider: claude on opus[*] nodes. A future YAML edit could silently remove the annotation.

Suggested test
it('bundled opus[1m] nodes always have explicit provider: claude', async () => {
  // Parse bundled workflow YAMLs
  // For each node with model containing 'opus', verify node.provider === 'claude' || workflow.provider === 'claude'
});

Recommendation: Create a follow-up issue — good defensive test but outside this PR's scope.


🟢 Low Issues

View 3 low-priority suggestions
Issue Location Suggestion
Substring check in check-bundled-skill.ts is a known limitation scripts/check-bundled-skill.ts:42-44 Acceptable for a safety-net script — YAGNI applies. Keep as-is.
Stale null comment in dag-executor.ts (pre-existing) packages/workflows/src/dag-executor.ts:315 Fix in follow-up: // undefined, symbol, bigint → empty (null is caught above by typeof check)
Docs: add provider/model independence warning packages/docs-web/src/content/docs/guides/authoring-workflows.md ~line 613 One sentence: "Always pair a provider-specific model string with an explicit provider: on the node."

📋 Suggested Follow-up Issues

Issue Title Priority
Add regression test: opus node without provider: routes to config.assistant P2
Add semantic test: bundled opus[*] nodes always have explicit provider: claude P3
Docs: add provider/model independence warning to authoring-workflows.md P2
Fix stale null comment in dag-executor.ts:315 P3

Next Steps

  1. No auto-fix needed — zero CRITICAL or HIGH issues
  2. Mark PR ready when CI passes (currently draft)
  3. Merge — fix is correct and complete

Reviewed by Archon comprehensive-pr-review workflow
Artifacts: .archon/workspaces/coleam00/Archon/artifacts/runs/7849040943c96c2ca0c1ca84db990094/review/

- Add regression tests for provider resolution (#1610): assert that a
  node with no provider: routes to workflowProvider, and that explicit
  provider: claude overrides workflowProvider even when set to 'codex'
- Add bundled opus invariant test: every default workflow node with an
  opus model must have provider: claude at node or workflow level
- Fix stale comment in dag-executor.ts:315 — null is caught by the
  typeof check above, not by this branch
- Docs: add provider/model independence warning to authoring-workflows.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coleam00

coleam00 commented May 9, 2026

Copy link
Copy Markdown
Owner Author

Review Fix Report

4 findings addressed (2 MEDIUM, 1 LOW code, 1 LOW docs). 0 findings skipped.

MEDIUM #1 — Regression test for provider resolution fallthrough

Added describe('provider resolution -- regression for #1610') in dag-executor.test.ts with two tests:

  • Asserts getAgentProvider is called with 'codex' when a node has model: opus[1m] but no provider: and workflowProvider = 'codex'
  • Asserts explicit provider: claude on the node correctly overrides workflowProvider

MEDIUM #2 — Bundled opus node content assertion

Added describe('bundled opus nodes -- provider annotation invariant (#1610)'):

  • Reads all YAMLs from .archon/workflows/defaults/ at test time
  • For every node with an opus model, asserts node.provider === 'claude' or workflow.provider === 'claude'
  • Fails with a clear file+node message if the invariant is violated

LOW — Fix stale comment in dag-executor.ts:315

// null, undefined, symbol, bigint → empty// undefined, symbol, bigint → empty (null is caught above by typeof check)

LOW — Docs: provider/model independence warning

Added one paragraph to authoring-workflows.md after the existing "never silently re-routes" sentence:

Provider selection is independent of the model string — a model: opus[1m] node with no provider: field will route to your defaultAssistant regardless of the model name. Always pair a provider-specific model string with an explicit provider: on the node.

Skipped

LOW #1 (substring check in check-bundled-skill.ts) — intentional, acknowledged in comment, YAGNI applies.

Validation

All checks pass: type-check ✓, lint ✓, all 10 package test suites ✓ (209 tests in workflows, 0 failures).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coleam00 coleam00 marked this pull request as ready for review May 9, 2026 16:03
@coleam00 coleam00 merged commit 78d32cf into dev May 9, 2026
3 of 4 checks passed
derpfoxie added a commit to derpfoxie/Archon that referenced this pull request May 10, 2026
合并上游 fix(workflows): add provider: claude to opus[1m] implement nodes (coleam00#1622)。

变更:
- 上游:3 个内置 workflow(feature-development / idea-to-pr / plan-to-pr)的 implement 节点
  补上 provider: claude,配合 opus[1m] 模型字符串路由到正确 provider
- 镜像:通过 generate:zh-workflows 自动同步到 3 个 -zh.yaml 镜像
- 重生成 bundled-defaults.generated.ts

冲突仅 bundled-defaults.generated.ts,已重生成;validate 全套 3571 pass / 0 fail。
@Wirasm Wirasm mentioned this pull request May 12, 2026
cropse pushed a commit to cropse/Archon that referenced this pull request May 19, 2026
…eam00#1622)

* fix(workflows): add provider: claude to opus[1m] nodes — closes coleam00#1610

Without an explicit `provider:` annotation, the DAG executor falls back to
`config.assistant` (default: `codex` for some users). Codex silently ignores
`opus[1m]`, completes in ~3 s with empty output, and downstream nodes receive
nothing. The three bundled workflow files that pair `model: opus[1m]` with no
`provider:` are now annotated with `provider: claude`.

Also fixes three pre-existing Windows CI issues: path-separator bug in
`check-bundled-skill.ts` (backslash vs forward slash), newline truncation in
`dag-executor.test.ts` script-failure test, and `IS_SANDBOX=1` guard skip in
`provider.test.ts` root-UID test. Regenerates `bundled-defaults.generated.ts`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(review): address review findings for PR coleam00#1622

- Add regression tests for provider resolution (coleam00#1610): assert that a
  node with no provider: routes to workflowProvider, and that explicit
  provider: claude overrides workflowProvider even when set to 'codex'
- Add bundled opus invariant test: every default workflow node with an
  opus model must have provider: claude at node or workflow level
- Fix stale comment in dag-executor.ts:315 — null is caught by the
  typeof check above, not by this branch
- Docs: add provider/model independence warning to authoring-workflows.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* simplify: replace for loop with .some() in isVersionRequest

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

DAG runner is skipping the "Implement" node when model is opus[1m]

1 participant