Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/server/handle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3426,6 +3426,17 @@ async function handleRequest(
// #301: the payload still overflows the window and
// preflight could not fix it — answer with a
// structured error instead of forwarding.
// #7376: this is the only egress decision point for the
// main payload. preflightCompressIfNeeded (above) runs
// to completion BEFORE forward() is ever reached (below,
// only when this branch is NOT taken) — it is a local
// token-estimate + fold computation with no upstream I/O
// for the MAIN body, so a fail-fast verdict means the
// main payload was never sent upstream. The only egress
// during preflight is the separate, smaller
// summarization call (external summary chain) — a
// different request, not the fail-fasted payload. The
// "NOT forwarded" wording is therefore always true.
if (respondFailFast && outcome.respond && !res.destroyed) {
if (res.headersSent) {
// #568: the hold already committed 200 early — the status
Expand Down
Loading