Repository navigation
port(omniroute): carry upstream status and retry hint in post-keepalive error frames - #1000
Merged
Merged
Conversation
…ve error frames Ports OmniRoute #14632, the keepalive-frame part of #14572, and the finish-reason part of #14247. Late failures after the early keepalive keep their status and Retry-After in a wire-correct frame (Responses error event with sequence_number, chat data error line, Anthropic event: error). OpenAI passthrough maps Claude stop_reason literals in finish_reason.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Ports OmniRoute #14632, the keepalive-frame part of #14572, and the finish-reason part of #14247.
Late failures keep their status. Once
earlyStreamKeepalivehas committed a 200, a later failure used to go out as a genericevent: errorwith the raw body, and the HTTP status andRetry-Afterwere lost. The final frame now matches the client's wire format:errorevent withsequence_number. It has no top-levelerrorkey, because openai-node would throw on one.data: {"error":…}line.event: error.Each carries
status_codeandretry_after_seconds(seconds or an HTTP date, capped at 0..3600)./v1/responsespasseserrorFormat: "responses"and/v1/messagespasseserrorFormat: "claude".Finish reasons on OpenAI passthrough. Streaming and non-streaming OpenAI passthrough now maps Claude
stop_reasonliterals infinish_reason(end_turn,tool_use, …) to OpenAI values through the existingtoOpenAIFinish(…, "claude"). Claude clients are unaffected.Not ported:
formatTranslatedStreamErroralready sendssequence_number: 0.Review notes:
pause_turnmaps totool_calls, following the fork's existing Claude translator. OmniRoute maps it tostop.event: errorline, as OpenAI's stream and ourformatTranslatedStreamErrordo.Tests
keepalive-error-frame-status.test.js(8 tests): each wire format, the HTTP-date cap, a missing header, a thrown handler, the fast path, and each route.openai-finish-reason-claude-literals.test.js(16 tests).test:ci: 0 assertion failures out of 12,131. The run was made on a heavily loaded machine, where one suite (db-concurrent) timed out inbeforeAll. That suite passes with a longer hook timeout and is unrelated to this change. GitHub CI is the authoritative run.Docs
docs/troubleshooting.mdx: new section "Streaming request fails after keepalive frames".Baseline impact
None.
Wire format and migration
The frame fields are additive. The fast path (the handler answers inside the threshold) is unchanged.