diff --git a/apps/server/src/codexAppServerManager.test.ts b/apps/server/src/codexAppServerManager.test.ts index 044a0fd1..2b5b9f7f 100644 --- a/apps/server/src/codexAppServerManager.test.ts +++ b/apps/server/src/codexAppServerManager.test.ts @@ -193,6 +193,12 @@ describe("classifyCodexStderrLine", () => { expect(classifyCodexStderrLine(line)).toBeNull(); }); + it("ignores known unauthenticated supabase mcp transport shutdown noise", () => { + const line = + '2026-04-07T11:04:55.822542Z ERROR rmcp::transport::worker: worker quit with fatal: Transport channel closed, when AuthRequired(AuthRequiredError { www_authenticate_header: "Bearer error=\\"invalid_request\\", error_description=\\"No access token was provided in this request\\", resource_metadata=\\"https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp\\"" })'; + expect(classifyCodexStderrLine(line)).toBeNull(); + }); + it("keeps unknown structured errors", () => { const line = "2026-02-08T04:24:20.085687Z ERROR codex_core::runtime: unrecoverable failure"; expect(classifyCodexStderrLine(line)).toEqual({ diff --git a/apps/server/src/codexAppServerManager.ts b/apps/server/src/codexAppServerManager.ts index ef3e55fa..d3c74866 100644 --- a/apps/server/src/codexAppServerManager.ts +++ b/apps/server/src/codexAppServerManager.ts @@ -161,6 +161,9 @@ const BENIGN_ERROR_LOG_SNIPPETS = [ "state db missing rollout path for thread", "state db record_discrepancy: find_thread_path_by_id_str_in_subdir, falling_back", ]; +const BENIGN_STDERR_MESSAGE_SNIPPETS = [ + 'worker quit with fatal: Transport channel closed, when AuthRequired(AuthRequiredError { www_authenticate_header: "Bearer error=\\"invalid_request\\", error_description=\\"No access token was provided in this request\\", resource_metadata=\\"https://mcp.supabase.com/.well-known/oauth-protected-resource/mcp\\""', +]; const RECOVERABLE_THREAD_RESUME_ERROR_SNIPPETS = [ "not found", "missing thread", @@ -518,6 +521,11 @@ export function classifyCodexStderrLine(rawLine: string): { message: string } | return null; } + const isBenignMessage = BENIGN_STDERR_MESSAGE_SNIPPETS.some((snippet) => line.includes(snippet)); + if (isBenignMessage) { + return null; + } + const match = line.match(CODEX_STDERR_LOG_REGEX); if (match) { const level = match[1];