Skip to content

fix: stabilize live error handling and quota recovery#471

Open
highkay wants to merge 1 commit intochenyme:mainfrom
highkay:fix/stabilize-live-errors
Open

fix: stabilize live error handling and quota recovery#471
highkay wants to merge 1 commit intochenyme:mainfrom
highkay:fix/stabilize-live-errors

Conversation

@highkay
Copy link
Copy Markdown
Contributor

@highkay highkay commented Apr 13, 2026

Summary

  • persist rate-limited quota exhaustion and refresh accounts on demand after 429 responses
  • restore account windows from stored quota metadata instead of basic-tier defaults, and normalize request validation plus transport failures into client-safe API errors
  • default public OpenAI/Anthropic compatible endpoints to non-streaming JSON unless stream=true is explicitly requested

Testing

  • docker run --rm -v /home/admin/grok2api-origin-pr:/workspace -w /workspace ghcr.io/chenyme/grok2api:latest python -m unittest tests.test_account_refresh_rate_limit tests.test_account_on_demand_refresh_trigger tests.test_account_selector_window_reset tests.test_transport_error_wrapping tests.test_public_api_stream_defaults

@highkay highkay force-pushed the fix/stabilize-live-errors branch from ccdd111 to b0fa0a4 Compare April 13, 2026 09:37
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.

2 participants