Repository navigation
Conversation
Stop bounded inspection at the first over-budget chunk and replay its complete prefix and remaining stream through the existing response pipes. Do not classify a partial response or alter its fake-completion streak. Keep retry idle timers and client-abort listeners until the live response and optional raw dump finish. Error-body truncation remains unchanged. Validation: 5 baseline behavior failures and 2 passing exact-cap controls; 74 targeted tests pass. Typecheck, build and static gates pass. Codex preflight finds the CLI/artifact but the live upstream is unavailable; the real four-phase E2E and full remote CI remain pending.
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.
Fixes #7405
Problem
The opt-in fake-completion path treats a capped error-body buffer as a complete successful response. It drains bytes beyond the inspection cap and then forwards only the prefix. Both proxy/plugin modes and initial/corrective responses are affected: text, real tool calls, usage and terminal events can disappear, and a JSON success can become unparseable.
Change
The streaming fallback retains at most the inspected prefix plus the current upstream chunk before normal backpressure takes over; it does not claim that one arbitrarily large incoming chunk is smaller than the configured cap.
Config surface
No field, environment variable, default or persistence format is added.
fakeCompletion.bufCapBytesremains the inspection-buffer guard (16 MiB by default); successful output is no longer silently truncated at that guard.fakeCompletion.retries=0remains the default. The en/zh configuration references describe the overflow behavior.Validation
Tested base:
1e357bf2d6632bfbd2a74ffb70ecee1af1ec7cc3.npm run typecheck,npm run build,npm run check:unused-exports,npm run check:test-import-graphandgit diff --checkpass.Related history
All-author/all-state duplicate screening found no equivalent change. #378/#486 introduced the shared fake-completion behavior; #1904 concerns the request used for a hinted retry. #7203 bounds separate rejected compression-replay error bodies.