Skip to content

Conversation

@ssncferreira
Copy link
Contributor

@ssncferreira ssncferreira commented Jan 23, 2026

Description

Adds unit tests to verify that upstream provider errors are correctly relayed to clients before streaming starts.
This was introduced after testing with providers where 429 (rate limit) responses appeared to be ignored. Investigation confirmed that aibridge was correctly relaying these errors, the issue was on the client side. These tests document and verify this behavior.

Changes

  • Added TestStreamingInterception_RelaysUpstreamErrorToClient
  • Tests cover 400 (bad request), 429 (rate limit), and 500 (internal server error) responses

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ssncferreira ssncferreira force-pushed the ssncferreira/test-chatcompletions-error-relay branch from 01cd399 to 5522ab9 Compare January 23, 2026 18:08
@ssncferreira ssncferreira marked this pull request as ready for review January 23, 2026 18:11
Copy link
Collaborator

@dannykopping dannykopping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@pawbana pawbana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have similar test for blocking.

@ssncferreira
Copy link
Contributor Author

Would be nice to have similar test for blocking.

True, and also for OpenAI's responses and Anthropic's messages. We can address those in follow-up PRs. I added this one because while testing the Copilot provider, it seemed like aibridge wasn't forwarding 429 responses to the client. Turned out the client was ignoring them. Added this test to confirm aibridge was correctly forwarding the error.

@ssncferreira ssncferreira merged commit bcc76df into main Jan 26, 2026
2 checks passed
@ssncferreira ssncferreira deleted the ssncferreira/test-chatcompletions-error-relay branch January 26, 2026 10:51
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.

3 participants