Repository navigation
Conversation
…8299) * fix(relay): report an untyped SSE error envelope as response.failed Some OpenAI-compatible gateways end a stream with an SSE data frame that is only `{"error":{...}}`, with no root `type`, followed by `[DONE]` and EOF. Both bare-error recognizers in src/server/relay.ts required a root `type: "error"`, so the frame was ignored and EOF synthesized `response.incomplete` with `adapter_eof`, dropping the diagnostic. Accept a frame with no root `type` that carries an `error` object in both `boundedBareUpstreamErrorMessage` (tee inspection) and `boundedBareUpstreamError` (client relay, tee and eager). A typed event of any other kind is still never treated as a bare error. Redaction, message bounds, class/code mapping and terminal precedence are unchanged. The combo preflight is left as is: it treats the untyped frame as a non-control event and commits the target, so it never resends it; the relay now reports the failure. A test pins that boundary. Closes #8216 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(relay): finish untyped error envelope handling across readers - Treat an untyped {"error":{...}} cyber_policy refusal as the policy terminal in both rewrite selection and terminal detection, like the typed error event, so later bytes are dropped. - Tee inspection uses the same structured extraction as the client boundary, so a refusal code without a message reports failed. - A code or error class without a message keeps a bounded fallback diagnostic and ends in response.failed instead of adapter_eof. - The SSE-to-WebSocket pump skips the untyped envelope instead of failing it as invalid JSON, so the boundary's terminal reaches WS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Ingwannu <ingwannu@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 9aeffab)
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
|
✅ Deterministic PR hygiene checks passed. |
This branch has not been 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.
Summary
Re-land of #8299, held as a draft. It was reverted in #8402, and its post-merge independent review FAILED: a P1 finding plus three P2s (details kept private; owned by the new-contributor merge lane). Do not merge it until the blocker is fixed with a failing-first test and a fresh independent review (and separate security review where applicable) passes.
Verification
dev.Checklist