Skip to content

fix: Docker deploys run the promised OpenRouter default (HARNESS_MODEL scoped to open_code) - #142

Merged
AbirAbbas merged 2 commits into
mainfrom
fix/harness-model-docker-default
Aug 23, 2026
Merged

fix: Docker deploys run the promised OpenRouter default (HARNESS_MODEL scoped to open_code)#142
AbirAbbas merged 2 commits into
mainfrom
fix/harness-model-docker-default

Conversation

@AbirAbbas

Copy link
Copy Markdown
Collaborator

Summary

An OpenRouter-only Railway/Docker deployment silently ran openrouter/moonshotai/kimi-k2.6 instead of the documented default openrouter/deepseek/deepseek-v4-flash-0731. Root cause: the images bake ENV HARNESS_MODEL=openrouter/moonshotai/kimi-k2.6 (needed so OpenCode's small_model config 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 the openrouter/… id into the claude_code/codex CLIs 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-team Railway template: the plan phase ran kimi-k2.6 on a deploy whose only model-relevant env var was OPENROUTER_API_KEY.

Changes (one commit per concern)

  1. fix(docker) — both images now bake HARNESS_MODEL=openrouter/deepseek/deepseek-v4-flash-0731, matching _OPENROUTER_AUTO_DEFAULT_MODEL / openRouterAutoDefaultModel and the README.
  2. fix(models) — the cascade consults HARNESS_MODEL only on the open_code runtime, in both nodes (Python + Go; main path, fast path, planning default). SWE_DEFAULT_MODEL / AI_MODEL keep steering every runtime. README + .env.example updated; the codex SWE_DEFAULT_MODEL caveat is gone because the failure mode is gone.

Validation contract → tests

  • OpenRouter-only Docker deploy resolves every role to openrouter/deepseek/deepseek-v4-flash-0731 → Dockerfile↔constant drift guard (TestDockerfileHarnessModelDefault), existing open_code cascade tests unchanged.
  • HARNESS_MODEL still steers open_code (main + fast) → existing tests + test_harness_model_scoped_to_open_code_in_fast, TestFastResolveModels_HarnessModelScopedToOpenCode.
  • claude_code/codex ignore HARNESS_MODEL and keep runtime defaults → test_harness_model_ignored_on_claude_code / _on_codex, TestResolveRuntimeModels_HarnessModelScopedToOpenCode.
  • SWE_DEFAULT_MODEL/AI_MODEL still 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 ./... in go/: clean
  • gofmt -l clean on touched files
  • After merge: redeploy the Railway template with only OPENROUTER_API_KEY and confirm the PM reasoner logs deepseek-v4-flash-0731

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits August 23, 2026 16:18
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>
@AbirAbbas
AbirAbbas merged commit 0c64fe7 into main Aug 23, 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