fix(sse): shrink chat.ts back under the frozen file-size cap (base-red drain) - #9598
Merged
Merged
Conversation
…ile-size cap The exact-model lock scope from #8630 pushed src/sse/handlers/chat.ts to 1880 lines (frozen cap 1877), turning ci.yml:lint -> check:file-size red on the release tip and making every new PR inherit the failure. Hoisted the scope ternary out of the recordModelLockoutFailure() object literal into a lockScope const, which collapses the 4-line object back to a single line, and condensed the adjacent comment. Behaviour is identical - same ternary, same argument. chat.ts: 1880 -> 1877 (at the frozen cap, no rebaseline needed). Also picks up one pre-existing Prettier normalisation at line 1547 (an #9184 line that was already failing prettier --check on the base) - the file is now prettier-clean.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…ile-size cap (diegosouzapw#9598) Validated in local merge-train (diegosouzapw batch)
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
npm run check:file-size(jobci.yml:lint) was red on therelease/v3.8.50tip:Every PR cut against that tip inherited the failure, so this drains it at the source.
Cause
The exact-model lock scope merged with #8630 expanded an inline argument object at the
recordModelLockoutFailure()chokepoint from 1 line to 4:Net +3 on a frozen god-file that had no headroom.
Fix — shrink, not rebaseline
Hoisted the ternary into a
lockScopeconst so the object collapses back to one line, andcondensed the adjacent comment (the
#8630rationale is preserved in it). Behaviour isidentical — same ternary, same argument value.
src/sse/handlers/chat.ts: 1880 → 1877, exactly at the frozen cap. No baseline entry wasadded —
config/quality/file-size-baseline.jsonis untouched.Out-of-scope line in the diff (disclosed)
The diff also contains one Prettier normalisation at line 1547 (an
isTerminalStreamEarlyEofcondition from #9184). That line was already failing
prettier --checkon the base tip —verified with
git show origin/release/v3.8.50:src/sse/handlers/chat.ts | npx prettier --check.It is behaviour-neutral and leaves the file Prettier-clean.
Validation
npm run check:file-sizeOK — 124 arquivos congelados+OK — 44 test files congeladosnpm run typecheck:corenpx eslint src/sse/handlers/chat.ts(with suppressions)npx prettier --check src/sse/handlers/chat.tsAll matched files use Prettier code style!model-lockout-decay,model-lockout-max-cooldown,model-lockout-exact-cooldown-cap,repro-antigravity-404-family-cooldown-hijack,account-fallback-service)The exact-model behaviour #8630 introduced stays covered —
Antigravity 404 Model Not Found locks exact model ONLY, not entire familyandAntigravity 429 Rate Limit locks whole familyboth pass.
No production behaviour changes, so no new test is added; the existing 93 assertions are the
regression guard for the wiring this touches.
Refs #8630