[fix]. Wire runner reasoning effort

This commit is contained in:
Space-Banane
2026-05-23 00:08:03 +02:00
parent 7bc6165fff
commit aeb924dcbb
2 changed files with 17 additions and 3 deletions

View File

@@ -76,10 +76,13 @@ def _build_install_and_run_command(settings: Settings) -> str:
]
)
model = settings.openai_review_model.strip()
reasoning_effort = settings.openai_reasoning_effort.strip()
codex_exec_parts = ["codex exec --skip-git-repo-check --json"]
if model:
steps.append(f"codex exec --skip-git-repo-check --json -m {shlex.quote(model)}")
else:
steps.append("codex exec --skip-git-repo-check --json")
codex_exec_parts.append(f"-m {shlex.quote(model)}")
if reasoning_effort:
codex_exec_parts.append(f"--reasoning-effort {shlex.quote(reasoning_effort)}")
steps.append(" ".join(codex_exec_parts))
return "; ".join(steps)

View File

@@ -59,6 +59,17 @@ def test_build_install_command_chatgpt_mode_copies_auth_json(monkeypatch: pytest
assert 'printf "%s" "$CODEX_AUTH_JSON_B64" | base64 -d > /root/.codex/auth.json' in command
assert "codex exec --skip-git-repo-check --json -m gpt-5.3-codex" in command
assert f"--reasoning-effort {settings.openai_reasoning_effort}" in command
def test_build_install_command_includes_configured_reasoning_effort(monkeypatch: pytest.MonkeyPatch) -> None:
monkeypatch.setenv("OPENAI_REASONING_EFFORT", "medium")
get_settings.cache_clear()
settings = get_settings()
command = _build_install_and_run_command(settings)
assert "--reasoning-effort medium" in command
def test_chatgpt_mode_requires_existing_auth_json(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None: