Skip to content

fix(sse): shrink chat.ts back under the frozen file-size cap (base-red drain) - #9598

Merged
diegosouzapw merged 1 commit into
release/v3.8.50from
fix/release-v3.8.50-filesize-drift
Aug 6, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.50from
fix/release-v3.8.50-filesize-drift

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

npm run check:file-size (job ci.yml:lint) was red on the release/v3.8.50 tip:

[file-size] 1 violação(ões):
  ✗ src/sse/handlers/chat.ts: 1880 > congelado 1877 (não pode crescer)

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:

{
  maxCooldownMs: mlSettings.maxCooldownMs,
  scope: provider === "antigravity" ? "exact" : undefined,
}

Net +3 on a frozen god-file that had no headroom.

Fix — shrink, not rebaseline

Hoisted the ternary into a lockScope const so the object collapses back to one line, and
condensed the adjacent comment (the #8630 rationale is preserved in it). Behaviour is
identical
— same ternary, same argument value.

src/sse/handlers/chat.ts: 1880 → 1877, exactly at the frozen cap. No baseline entry was
added
— config/quality/file-size-baseline.json is untouched.

Out-of-scope line in the diff (disclosed)

The diff also contains one Prettier normalisation at line 1547 (an isTerminalStreamEarlyEof
condition from #9184). That line was already failing prettier --check on 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

Check Result
npm run check:file-size OK — 124 arquivos congelados + OK — 44 test files congelados
npm run typecheck:core exit 0
npx eslint src/sse/handlers/chat.ts (with suppressions) exit 0, clean
npx prettier --check src/sse/handlers/chat.ts All matched files use Prettier code style!
model-lockout + account-fallback suites 93/93 pass (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 family and Antigravity 429 Rate Limit locks whole family
both 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

…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.
@diegosouzapw
diegosouzapw merged commit ba0a075 into release/v3.8.50 Aug 6, 2026
11 checks passed
@diegosouzapw
diegosouzapw deleted the fix/release-v3.8.50-filesize-drift branch August 6, 2026 13:40
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant