You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(agents): provider-specific errors misclassified during failover #58837
classifyFailoverReason() in src/agents/pi-embedded-helpers/errors.ts relies on generic string matching that misclassifies errors from several providers. This causes the failover engine to choose wrong recovery strategies — for example, retrying with the same oversized context instead of triggering compaction, or treating a rate limit as an unknown error.
Examples of Misclassification
Provider
Error Message
Expected
Actual
AWS Bedrock
ThrottlingException: Too many concurrent requests
rate_limit
null (unclassified)
AWS Bedrock
ModelNotReadyException: model is not ready
overloaded
null
Groq
model_is_deactivated
model_not_found
null
Together AI
concurrency limit has been reached
rate_limit
null
Google Vertex
INVALID_ARGUMENT: exceeds the maximum input tokens
context overflow
null
Impact
Incorrect failover decisions waste API credits (retrying instead of switching model/provider)
Users on providers like Bedrock, Together AI, Groq see unexpected failures instead of graceful failover
Expected Behavior
Provider-specific error patterns should be normalized to the existing FailoverReason enum so the failover engine can make correct decisions regardless of which provider returned the error.
Activity