fix(codeagent-wrapper): filter codex stderr noise logs

Add codexNoisePatterns to filter "ERROR codex_core::codex: needs_follow_up:"
messages from stderr output when using the codex backend.

Generated with SWE-Agent.ai

Co-Authored-By: SWE-Agent.ai <noreply@swe-agent.ai>
This commit is contained in:
cexll
2026-01-15 14:59:31 +08:00
parent 0fc5eaaa2d
commit e7f329940b
2 changed files with 8 additions and 0 deletions

View File

@@ -983,6 +983,9 @@ func runCodexTaskWithContext(parentCtx context.Context, taskSpec TaskSpec, backe
if cfg.Backend == "gemini" {
stderrFilter = newFilteringWriter(os.Stderr, geminiNoisePatterns)
stderrOut = stderrFilter
} else if cfg.Backend == "codex" {
stderrFilter = newFilteringWriter(os.Stderr, codexNoisePatterns)
stderrOut = stderrFilter
}
stderrWriters = append([]io.Writer{stderrOut}, stderrWriters...)
}

View File

@@ -18,6 +18,11 @@ var geminiNoisePatterns = []string{
"YOLO mode is enabled",
}
// codexNoisePatterns contains stderr patterns to filter for codex backend
var codexNoisePatterns = []string{
"ERROR codex_core::codex: needs_follow_up:",
}
// filteringWriter wraps an io.Writer and filters out lines matching patterns
type filteringWriter struct {
w io.Writer