From f8d086ded1bbd71300cc676326ef15512b824a09 Mon Sep 17 00:00:00 2001 From: Jim Park Date: Sat, 4 Apr 2026 22:31:22 -0700 Subject: [PATCH] fix: remove overly broad agent+undefined error pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The (message.includes("agent") && message.includes("undefined")) pattern could match unrelated errors like "The agent returned undefined for the configuration", triggering a false fallback that hides the real failure. The two precise patterns are sufficient: - "Agent not found" — canonical SDK validation error - "agent.name" — property access error on undefined agent config Co-Authored-By: Claude Opus 4.6 (1M context) --- src/features/background-agent/spawner.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/features/background-agent/spawner.ts b/src/features/background-agent/spawner.ts index 1ae9f078d..3c2fd7e73 100644 --- a/src/features/background-agent/spawner.ts +++ b/src/features/background-agent/spawner.ts @@ -21,8 +21,7 @@ export function isAgentNotFoundError(error: unknown): boolean { : String(error) return ( message.includes("Agent not found") || - message.includes("agent.name") || - (message.includes("agent") && message.includes("undefined")) + message.includes("agent.name") ) }