fix(go): direct role calls default to the configured runtime, not claude/sonnet - #120
Merged
Merged
Conversation
…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>
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.
Summary
Direct reasoner calls (e.g.
POST /api/v1/execute/swe-planner-go.run_product_manager) hard-codedai_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 thoughconfig.DefaultRuntime()already auto-selectsopen_codethere and the orchestrators already resolve correctly. Verified live on a Railway control plane.Changes Made
ai_providerresolves throughconfig.DefaultRuntime()at call time; absent/emptymodelthroughconfig.DefaultPlanningModel()(planning roles) or the newconfig.DefaultRoleModel(role)(coding/gitops), which reusesResolveRuntimeModels+RoleToTier— no new precedence policy.model="sonnet",ai_provider="claude"), which have the same direct-call problem — happy to mirror this fix inswe_af/as a follow-up.Test Plan
gofmtclean,go build,go vetgo test -race -count=1 ./...— 27 packages, all green (CI's exact flags)SWE_DEFAULT_RUNTIME=codexoverride, explicit-values-untouched, for planning and coding roles🤖 Generated with Claude Code