From e7f329940bad56962f96d3f6bac3870ae462c92f Mon Sep 17 00:00:00 2001 From: cexll Date: Thu, 15 Jan 2026 14:59:31 +0800 Subject: [PATCH] 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 --- codeagent-wrapper/executor.go | 3 +++ codeagent-wrapper/filter.go | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/codeagent-wrapper/executor.go b/codeagent-wrapper/executor.go index 66acde1..653942a 100644 --- a/codeagent-wrapper/executor.go +++ b/codeagent-wrapper/executor.go @@ -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...) } diff --git a/codeagent-wrapper/filter.go b/codeagent-wrapper/filter.go index ab5c522..f75d388 100644 --- a/codeagent-wrapper/filter.go +++ b/codeagent-wrapper/filter.go @@ -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