From 234c410897285e69e00cf851163a66c1baef40ea Mon Sep 17 00:00:00 2001 From: Abir Abbas Date: Wed, 6 May 2026 17:47:38 -0400 Subject: [PATCH] fix(opencode): use {env:HARNESS_MODEL} interpolation in baked-in config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The baked-in opencode.json hardcoded both model and small_model to a literal kimi-k2.5 string, so OpenCode's small_model path (used for session titles and prompt compaction) silently bypassed whatever HARNESS_MODEL the deployer set on Railway. Per-call -m on `opencode run` already pins the main model from HARNESS_MODEL via the Python harness provider; this aligns the small_model path the same way. OpenCode supports {env:VAR} interpolation in string fields. Switch model and small_model to {env:HARNESS_MODEL} so they track the env var the rest of the pr-af stack already reads. The Dockerfile already sets HARNESS_MODEL=openrouter/moonshotai/kimi-k2.5 as the image default, so fresh containers without overrides still have a value to interpolate. Also drops the now-redundant `models` registration block — OpenCode auto-handles unknown model names from a configured provider, and pinning a specific name there broke the moment HARNESS_MODEL changed. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ecec253..b5f198f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -59,7 +59,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ rm -rf /var/lib/apt/lists/* RUN mkdir -p /home/praf/.config/opencode && \ - echo '{"$schema":"https://opencode.ai/config.json","model":"openrouter/moonshotai/kimi-k2.5","small_model":"openrouter/moonshotai/kimi-k2.5","provider":{"openrouter":{"options":{"apiKey":"{env:OPENROUTER_API_KEY}"},"models":{"moonshotai/kimi-k2.5":{}}}}}' \ + echo '{"$schema":"https://opencode.ai/config.json","model":"{env:HARNESS_MODEL}","small_model":"{env:HARNESS_MODEL}","provider":{"openrouter":{"options":{"apiKey":"{env:OPENROUTER_API_KEY}"}}}}' \ > /home/praf/.config/opencode/opencode.json && \ chown -R praf:praf /home/praf/.config