Skip to content

fix(executor): handle CommandCode in-stream errors for combo and account fallback - #3405

Open
berthojoris wants to merge 1 commit into
decolua:masterfrom
berthojoris:fix/commandcode-error-fallback
Open

fix(executor): handle CommandCode in-stream errors for combo and account fallback#3405
berthojoris wants to merge 1 commit into
decolua:masterfrom
berthojoris:fix/commandcode-error-fallback

Conversation

@berthojoris

Copy link
Copy Markdown
Contributor

Summary

  • Add early inspection (inspectAndWrapCommandCodeResponse) to CommandCode streaming responses to detect in-stream errors before streaming tokens downstream.
  • Map in-stream CommandCode errors (e.g. overloaded / 503, rate-limited / 429) to proper non-200 HTTP responses.
  • Enables combo and account fallback mechanisms to properly trigger when upstream CommandCode returns an error payload inside an HTTP 200 stream.
  • Replays buffered chunks losslessly for normal non-error streams into OpenAI SSE format.
  • Add parseError implementation to CommandCodeExecutor and helper parseCommandCodeError.

Test Plan

  • tests/unit/commandcode-to-openai.test.js (9 tests passed)
  • tests/unit/commandcode-executor.test.js (7 tests passed)
  • Baseline verifications passed:
    • verify-alias.mjs
    • verify-oauth-urls.mjs
    • verify-providers.mjs

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