fix: Docker deploys run the promised OpenRouter default (HARNESS_MODEL scoped to open_code) - #142
Merged
Merged
Conversation
The images set ENV HARNESS_MODEL=openrouter/moonshotai/kimi-k2.6 as an OpenCode small_model fallback, but the model-resolution env cascade reads HARNESS_MODEL — so every OpenRouter-only Docker/Railway deployment silently ran kimi instead of the documented auto default openrouter/deepseek/deepseek-v4-flash-0731. Point the baked value at the auto default. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
HARNESS_MODEL is an OpenCode-ecosystem variable: it feeds OpenCode's small_model via config interpolation, and the Docker image bakes a default value precisely so that interpolation always resolves. Having it in the model cascade for every runtime pushed that baked openrouter/… id into the claude_code and codex CLIs on Docker deployments, breaking both unless the deployer also set SWE_DEFAULT_MODEL (the README documented the codex failure instead of fixing it). Scope the cascade's HARNESS_MODEL step to open_code in both the Python and Go nodes (main path, fast path, planning default). SWE_DEFAULT_MODEL and AI_MODEL keep steering every runtime. Adds contract tests on both sides and a drift guard pinning the Dockerfiles' baked value to _OPENROUTER_AUTO_DEFAULT_MODEL; updates README / .env.example accordingly. 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
An OpenRouter-only Railway/Docker deployment silently ran
openrouter/moonshotai/kimi-k2.6instead of the documented defaultopenrouter/deepseek/deepseek-v4-flash-0731. Root cause: the images bakeENV HARNESS_MODEL=openrouter/moonshotai/kimi-k2.6(needed so OpenCode'ssmall_modelconfig interpolation always has a value), and the model-resolution env cascade (SWE_DEFAULT_MODEL → AI_MODEL → HARNESS_MODEL) treated that baked value as deployer intent — for every runtime. That also pushed theopenrouter/…id into theclaude_code/codexCLIs on Docker deploys (the README documented the codex ~13s PM failure as a caveat instead of fixing it).Found while smoke-testing the
agentfield-engineering-teamRailway template: theplanphase rankimi-k2.6on a deploy whose only model-relevant env var wasOPENROUTER_API_KEY.Changes (one commit per concern)
fix(docker)— both images now bakeHARNESS_MODEL=openrouter/deepseek/deepseek-v4-flash-0731, matching_OPENROUTER_AUTO_DEFAULT_MODEL/openRouterAutoDefaultModeland the README.fix(models)— the cascade consultsHARNESS_MODELonly on theopen_coderuntime, in both nodes (Python + Go; main path, fast path, planning default).SWE_DEFAULT_MODEL/AI_MODELkeep steering every runtime. README +.env.exampleupdated; the codexSWE_DEFAULT_MODELcaveat is gone because the failure mode is gone.Validation contract → tests
openrouter/deepseek/deepseek-v4-flash-0731→ Dockerfile↔constant drift guard (TestDockerfileHarnessModelDefault), existing open_code cascade tests unchanged.HARNESS_MODELstill steersopen_code(main + fast) → existing tests +test_harness_model_scoped_to_open_code_in_fast,TestFastResolveModels_HarnessModelScopedToOpenCode.claude_code/codexignoreHARNESS_MODELand keep runtime defaults →test_harness_model_ignored_on_claude_code/_on_codex,TestResolveRuntimeModels_HarnessModelScopedToOpenCode.SWE_DEFAULT_MODEL/AI_MODELstill apply to every runtime →test_swe_default_model_still_applies_on_claude_code+ Go assertions.Test plan
make check(pytest full suite): 1214 passed, 1 skipped (Python 3.12,pip install -e ".[dev]"per CI)go vet ./...&&go test -race -count=1 ./...ingo/: cleangofmt -lclean on touched filesOPENROUTER_API_KEYand confirm the PM reasoner logsdeepseek-v4-flash-0731🤖 Generated with Claude Code