From 661656c587539b065aa6c66e480152a5ee7b9916 Mon Sep 17 00:00:00 2001 From: cexll Date: Wed, 14 Jan 2026 17:04:21 +0800 Subject: [PATCH] fix(codeagent-wrapper): use config override for codex reasoning effort Replace invalid `--reasoning-effort` CLI flag with `-c model_reasoning_effort=` config override, as codex does not support the former. Generated with SWE-Agent.ai Co-Authored-By: SWE-Agent.ai --- codeagent-wrapper/executor.go | 2 +- codeagent-wrapper/main_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codeagent-wrapper/executor.go b/codeagent-wrapper/executor.go index 9b5bf65..66acde1 100644 --- a/codeagent-wrapper/executor.go +++ b/codeagent-wrapper/executor.go @@ -766,7 +766,7 @@ func buildCodexArgs(cfg *Config, targetArg string) []string { } if reasoningEffort := strings.TrimSpace(cfg.ReasoningEffort); reasoningEffort != "" { - args = append(args, "--reasoning-effort", reasoningEffort) + args = append(args, "-c", "model_reasoning_effort="+reasoningEffort) } args = append(args, "--skip-git-repo-check") diff --git a/codeagent-wrapper/main_test.go b/codeagent-wrapper/main_test.go index 8c537f1..dce1fac 100644 --- a/codeagent-wrapper/main_test.go +++ b/codeagent-wrapper/main_test.go @@ -1970,7 +1970,7 @@ func TestRunBuildCodexArgs_NewMode_WithReasoningEffort(t *testing.T) { args := buildCodexArgs(cfg, "my task") expected := []string{ "e", - "--reasoning-effort", "high", + "-c", "model_reasoning_effort=high", "--skip-git-repo-check", "-C", "/test/dir", "--json", @@ -2010,13 +2010,13 @@ func TestRunCodexTaskWithContext_CodexReasoningEffort(t *testing.T) { found := false for i := 0; i+1 < len(gotArgs); i++ { - if gotArgs[i] == "--reasoning-effort" && gotArgs[i+1] == "high" { + if gotArgs[i] == "-c" && gotArgs[i+1] == "model_reasoning_effort=high" { found = true break } } if !found { - t.Fatalf("expected --reasoning-effort high in args, got %v", gotArgs) + t.Fatalf("expected -c model_reasoning_effort=high in args, got %v", gotArgs) } }