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:
@@ -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")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user