Repository navigation
fix(combo): preserve terminal upstream error codes - #15154
Merged
diegosouzapw merged 2 commits intoOct 2, 2026
Merged
diegosouzapw merged 2 commits into
diegosouzapw merged 2 commits into
Conversation
diegosouzapw
merged commit Oct 2, 2026
c74037b
into
diegosouzapw:release/v3.8.52
10 of 16 checks passed
Owner
|
Thanks @shipsfromrio — merged into |
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.
Problem
When every target of a combo fails, the aggregated error drops the terminal upstream error
code. A Responses client that getsinvalid_encrypted_contentfrom the last target sees a genericbad_requestinstead, so it can't tell that it should drop the replayed reasoning item and retry.executeTargetAttempt.tsrecorded each failure without its structured code,comboAttemptLoop.tsrebuilt the terminal error without a code, andutils/error.tsthen fell back to the status-based default. The round-robin path returned a bare{ error: { message } }body.Closes #15139
Fix
structuredError.codeon each combo failure entry (priority and round-robin paths).resolveComboTerminalCode()keeps the terminal target's code only when it represents the aggregate verdict: same status and the same failure class for every entry. Mixed failures keep today's aggregate status and generic code.errorResponse(), so its body gets the same shape and message sanitization as the priority path.Tests
New
tests/unit/combo-error-code-terminal.test.ts: Responses SSE frames, fallback, missing codes, sanitization and mixed failures. Seven assertions fail with the source change reverted. Withcombo-terminal-status-policy-10501.test.ts, 13/13 pass locally.