From fb1a4241f4a0e32d21874eaee072f765aebd4519 Mon Sep 17 00:00:00 2001 From: rschumann Date: Sun, 9 Aug 2026 14:47:38 +0200 Subject: [PATCH] fix(codex): pin the model explicitly, because --ignore-user-config discards it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodexValidator passes --ignore-user-config, which throws away ~/.codex/config.toml — so the user's configured default model never reached lope and codex validated with whatever the CLI's built-in default happened to be. Pin it explicitly instead, overridable with LOPE_CODEX_MODEL. Reasoning effort stays "low" on purpose: these are fast pass/fail gates, and xhigh would make every validation slow and expensive. For a heavyweight opinion, call `codex exec` directly — it reads the user config. This change was written 2026-08-07 and has been running locally in the deployed checkout ever since, committed to no branch. Committing it so it survives the next release resync. Co-Authored-By: Claude Opus 5 (1M context) --- lope/validators.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lope/validators.py b/lope/validators.py index dc1508b..671bf22 100644 --- a/lope/validators.py +++ b/lope/validators.py @@ -1668,6 +1668,14 @@ def validate( # ─── Codex validator ─────────────────────────────────────────── +# 2026-08-07: --ignore-user-config below discards ~/.codex/config.toml, so the user's default +# model never reached lope. Pin it explicitly instead. Reasoning stays "low" on purpose (see the +# comment in generate()): these are fast pass/fail gates, and xhigh would make every validation +# slow and expensive. For a heavyweight opinion call `codex exec` directly, which reads the user +# config (gpt-5.6-sol / xhigh). Override without editing this file: LOPE_CODEX_MODEL=. +CODEX_MODEL = os.environ.get("LOPE_CODEX_MODEL", "gpt-5.6-sol") + + class CodexValidator(Validator): """Wraps `codex exec ""` for validated review.""" @@ -1726,6 +1734,8 @@ def generate( "--skip-git-repo-check", "-s", "workspace-write" if implementation_mode else "read-only", + "-m", + CODEX_MODEL, "-c", 'model_reasoning_effort="low"', ], @@ -1764,6 +1774,8 @@ def validate( "--skip-git-repo-check", "-s", "read-only", + "-m", + CODEX_MODEL, "-c", 'model_reasoning_effort="low"', ],