Skip to content

fix(provider): include bankr and openai_responses in OpenAI-compatible failure classifier - #1127

Open
bukeeastrey wants to merge 1 commit into
use-agent-os:mainfrom
bukeeastrey:fix/provider-failures-bankr-openai-responses
Open

fix(provider): include bankr and openai_responses in OpenAI-compatible failure classifier#1127
bukeeastrey wants to merge 1 commit into
use-agent-os:mainfrom
bukeeastrey:fix/provider-failures-bankr-openai-responses

Conversation

@bukeeastrey

Copy link
Copy Markdown
Contributor

Summary

Adds "bankr", "openai_responses", "volcengine_coding_plan", and "byteplus_coding_plan" to _OPENAI_COMPAT_PROVIDERS in failures.py so provider errors are correctly classified into actionable ProviderFailureKind states.

Problem

_OPENAI_COMPAT_PROVIDERS determines which providers use standard OpenAI HTTP error status classification. Because "bankr" and "openai_responses" were missing from this set:

  • 401 / 403 errors were not mapped to ProviderFailureKind.AUTH_INVALID
  • 402 errors were not mapped to ProviderFailureKind.INSUFFICIENT_CREDITS
  • 404 / 400 errors were not mapped to ProviderFailureKind.MODEL_NOT_FOUND / BAD_REQUEST
  • The runtime's decide_recovery_action() fell back to SURFACE rather than triggering doctor diagnostics, credential failures, or provider failover.

Changes Made

  • Added "bankr", "openai_responses", "volcengine_coding_plan", and "byteplus_coding_plan" to _OPENAI_COMPAT_PROVIDERS in src/agentos/provider/failures.py.
  • Extended the test parametrization in tests/test_provider_failure_classification.py to cover all newly registered providers across all failure status codes.

Verification

uv run pytest tests/test_provider_failure_classification.py tests/test_provider_failures.py -q
# 123 passed in 2.74s

uv run ruff check src/agentos/provider/failures.py tests/test_provider_failure_classification.py
# All checks passed!

uv run mypy src/agentos/provider/failures.py --show-error-codes
# Success: no issues found in 1 source file
closes #1126 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant