Repository navigation
fix(sse,compression): graceful silent-close truncation + compressToolResults boolean guard - #10805
Merged
diegosouzapw merged 2 commits intoAug 21, 2026
Conversation
added 2 commits
August 20, 2026 11:39
…ose (diegosouzapw#7699) createDisconnectAwareStream now distinguishes graceful truncation (partial content already reached client -> clean Claude message_stop, no 'event: error') from real empty-content failure (diegosouzapw#8649 -> still emits 502 error, no fake 'max_tokens'). Note: empty-content Claude error message intentionally changed from "Upstream stream ended without terminal marker" to "Provider returned empty content" - user-visible.
… step config
lite engine stepConfig is Record<string, unknown>; malformed value
leaked through the config chain as {}. Now a typeof === "boolean"
guard; falls through to config.lite then default true.
minhlongs
force-pushed
the
fix/silent-sse-close-7699
branch
from
August 20, 2026 04:42
da182ef to
48f443f
Compare
xiaoyaner0201
added a commit
to xiaoyaner0201/OmniRoute
that referenced
this pull request
Aug 21, 2026
…fd4040) Additive two-parent merge onto the current live head, which advanced again during O5/R6 from b87056a to 6fd4040 (five commits: diegosouzapw#10830 Grok Build custom host, diegosouzapw#10854 skills marketplace API-key installs, diegosouzapw#10804 Cursor account Agent endpoint, diegosouzapw#10531 freebuff translate-path golden regen, diegosouzapw#10805 SSE silent-close truncation). Zero file overlap with this PR's 34-file diff; the merge is conflict-free and introduces no adaptation of either side. No force, rebase, amend, or squash.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…Results boolean guard (diegosouzapw#10805) Two fixes: (1) createDisconnectAwareStream now distinguishes graceful max_tokens truncation (partial content already reached the client, upstream closes without a terminal marker → clean stop, no error) from a real empty-content failure (still surfaces the 502). Fixes diegosouzapw#7699, keeps diegosouzapw#8649 intact. (2) liteEngine's compressToolResults now requires an explicit boolean before overriding step config, instead of letting a malformed value leak through the `??` chain. Validated in an isolated worktree boarded onto origin/release/v3.8.50 (0 conflicts, 4 files): - 68/68 tests pass (silent-sse-close-7699, compression/lite, empty-stream-no-content-8649, stream-handler). - check-file-size, check-changelog-integrity: OK. - typecheck:core: clean. - check-complexity / check-cognitive-complexity: OK, both under baseline. Note: the empty-content Claude error message text changed from "Upstream stream ended without a terminal marker" to "Provider returned empty content" (matches the OpenAI/Responses branch wording) — intentional, documented in the PR. Co-authored-by: minhlongs <minhlongs@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
Two production fixes shipped from a worktree off
release/v3.8.50(2f5eca2b5).1. fix(sse): graceful max_tokens truncation on silent mid-stream close (#7699)
createDisconnectAwareStreamnow distinguishes:message_stop(stop_reason: max_tokens), noevent: error. The client keeps the valid partial response.Provider returned empty content), not a fakemax_tokensstop.2. fix(compression): only explicit boolean compressToolResults overrides step config
liteEngine:stepConfigisRecord<string, unknown>, so a malformedcompressToolResultsvalue leaked through the??chain as{}. Now guarded withtypeof === "boolean"; falls through toconfig.lite, then defaulttrue.Verification
empty-stream-no-content-8649.test.ts,stream-handler.test.ts)npm run typecheck:corecleanFiles
open-sse/utils/streamHandler.ts+tests/unit/silent-sse-close-7699.test.tsopen-sse/services/compression/engines/cavemanAdapter.ts+tests/unit/compression/lite.test.ts[ccr_blocks, job_registry]instream-utilities.test.tsartifact rotation; pre-existing, out of scope).