Repository navigation
aiclient: preserve Responses API incomplete-response reasons - #3290
Merged
Hillary Mutisya (hillary-mutisya) merged 1 commit intoNov 18, 2026
Merged
Hillary Mutisya (hillary-mutisya) merged 1 commit into
Hillary Mutisya (hillary-mutisya) merged 1 commit into
Conversation
Include provider incomplete_details.reason in both non-streaming and streaming failures while continuing to reject partial output. Keep generic failures for absent or malformed reasons and cover both paths with offline regressions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
incomplete_details.reasonin Responses API incomplete-output errors for both ordinary responses andresponse.incompletestream events.Motivation
The generic incomplete-response error hides whether a provider stopped for
max_output_tokens,content_filter, or another reported reason. Preserve that diagnostic at the adapter boundary without turning partial output into a successful response.Behavior and compatibility
For a nonempty string reason, errors now read
Model response is incomplete (reason: max_output_tokens). Streaming still throws and non-streaming still returns a failed result. Missing response envelopes and missing or malformed reason metadata still fail withModel response is incomplete.No model routing, request limits, response acceptance, credential handling, or retry policy changes. This does not increase output budgets or retry incomplete responses.
Reviewer guide
Validation
Local Windows validation at
dab6dbf7aecede923c79d14041e6945f3af371b4; commands run fromts:pnpm run buildpnpm run prettier:changedpnpm run code-lint -- --ratchet --base origin/mainpnpm run code-complexity -- --ratchet --base origin/main --cyclomatic 25 --cognitive 30 --new-file-cyclomatic 25 --new-file-cognitive 30pnpm run code-circular -- --ratchet --base origin/main --exceptions-file tools/scripts/code/circular-baseline-exception.jsonpnpm run code-debt -- --gate --base origin/maingit diff --checkThe first local circular scan could not run its checkout hook because Git LFS was absent from its process PATH. Rerunning with the existing portable Git LFS dependency available passed, without bypassing hooks or changing the gate.
Tests use synthetic provider responses; no live inference was performed. CI results are separate from these local checks.
Risks and rollback
Consumers matching the complete generic error string will now see an appended reason when one is provided. The existing error prefix is unchanged. Reverting this PR restores generic messages; no migration is needed.