fix: remove overly broad agent+undefined error pattern

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) <noreply@anthropic.com>
This commit is contained in:
Jim Park
2026-04-04 22:31:22 -07:00
parent 51508c4949
commit f8d086ded1
+1 -2
View File
@@ -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")
)
}