Skip to content

fix(go): direct role calls default to the configured runtime, not claude/sonnet - #120

Merged
AbirAbbas merged 1 commit into
mainfrom
fix/direct-call-runtime-defaults
Aug 1, 2026
Merged

fix(go): direct role calls default to the configured runtime, not claude/sonnet#120
AbirAbbas merged 1 commit into
mainfrom
fix/direct-call-runtime-defaults

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

Direct reasoner calls (e.g. POST /api/v1/execute/swe-planner-go.run_product_manager) hard-coded ai_provider: "claude" / model: "sonnet", ignoring the deployment's configured runtime. On an OpenRouter-only setup — the common cloud deploy — every direct role call tried the claude harness and failed in ~500ms, even though config.DefaultRuntime() already auto-selects open_code there and the orchestrators already resolve correctly. Verified live on a Railway control plane.

Changes Made

  • Absent/empty ai_provider resolves through config.DefaultRuntime() at call time; absent/empty model through config.DefaultPlanningModel() (planning roles) or the new config.DefaultRoleModel(role) (coding/gitops), which reuses ResolveRuntimeModels + RoleToTier — no new precedence policy.
  • Explicit input values are used verbatim, so orchestrator-threaded calls are byte-identical (covered by tests).
  • Known divergence from the Python port's literal signature defaults (model="sonnet", ai_provider="claude"), which have the same direct-call problem — happy to mirror this fix in swe_af/ as a follow-up.

Test Plan

  • gofmt clean, go build, go vet
  • go test -race -count=1 ./... — 27 packages, all green (CI's exact flags)
  • New tests: OpenRouter-only defaults, SWE_DEFAULT_RUNTIME=codex override, explicit-values-untouched, for planning and coding roles

🤖 Generated with Claude Code

…ude/sonnet

Direct reasoner calls hard-coded ai_provider=claude and model=sonnet,
so on an OpenRouter-only deployment (the common cloud setup) every
direct role call tried the claude harness and failed instantly - even
though config.DefaultRuntime() already auto-selects open_code there and
the orchestrators already resolve properly. Resolve absent runtime and
model inputs at call time through the existing config cascade
(SWE_DEFAULT_RUNTIME, tier env vars, OpenRouter auto-default); explicit
input values are untouched. Adds config.DefaultRoleModel backed by
ResolveRuntimeModels/RoleToTier so coding and gitops roles pick their
tier-correct model.

Verified live on a Railway control plane where run_product_manager
failed in 500ms with the old defaults and succeeded via opencode with
provider overrides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit 7a8dba0 into main Aug 1, 2026
3 checks passed
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.

1 participant