Skip to content

CL-8979: page large read_file responses through to the end - #1180

Merged
TheGreatAxios merged 7 commits into
mainfrom
cl-8979-make-large-read_file-responses-explicitly-and-reliably
Sep 27, 2026
Merged

TheGreatAxios merged 7 commits into
mainfrom
cl-8979-make-large-read_file-responses-explicitly-and-reliably

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Greens the red paging tests from d4de77f.

  • Resume seeks to the stored resume point; bytes skipped to reach a nonzero offset no longer count against the 8MB scan ceiling, so continuation on files larger than the ceiling reads through to the end.
  • Overlong single lines are windowed into offset-continuable pages; the tail is reachable by continuation, not only by grep.
  • Byte/scan-limit pages carry a dual footer (plain path+offset plus cursor alias); the model-facing path+offset chain stays first-class and fresh-instance-resumable.
  • Footer-bearing read_file pages pass the result-truncation layer byte-identical (no 10k re-cut, no spill); line-limit pages keep the cursor-only form.
  • Re-reading an unconsumed resumption point reuses its live cursor; consumed cursors stay retired for stale replays.
  • read_file registry docs describe the offset/limit page-and-continue contract.
  • Updates the posix-stack test that pinned the old grep-only dead end to the new paging contract; 10k cap and 8MB ceiling unchanged; no new tool or argument.

Second-pass critic follow-up (reactor 10k footer):

  • Size-cap shape: skip createSizeCapTransform for footer-bearing read_file pages (same Use offset= predicate leisure already uses). Pages stay at the 50KB budget. The global 10k cap is unchanged for every other tool and for read_file results without a continuation footer. Shrinking pages to 10k was rejected because it would defeat paging.
  • Guard then leisure then createSizeCapTransform(10k) keeps Use offset= and is byte-identical to the leisure page.
  • Dead offsets on files larger than the 8MB scan ceiling report beyond-EOF with the path and valid range ([offset N is beyond end of file PATH (M lines); valid offsets 0-(M-1)]), not the scan-limit. Skip bytes still do not count against the scan ceiling.

Verification: bun run typecheck exit 0; bun run lint exit 0; bun test ./src ./tests ./evals ./scripts --randomize --seed 424242: 8036 pass 0 fail.

Fixes CL-8979

@linear-code

linear-code Bot commented Sep 26, 2026

Copy link
Copy Markdown

CL-8979

Deep pages past the scan ceiling, path+offset chains, blob resume without re-scan, overlong-line windowing, truncation pass-through, loop-detector and registry pins. All five paging tests fail before the fix; pins hold.
Large-file pages used to dead-end: the scan ceiling fired while unread
content remained, overlong lines were grep-only, and the 10k re-cut
mangled footer-bearing pages. Resume now seeks to the stored point,
pages carry both offset and cursor continuations, and footer-bearing
pages pass the truncation layer untouched.
Drop the dual footer and live-cursor reuse so continuation is a single stateless path+offset notice, matching the single-way resume direction. Pre-existing cursor tests become same-URI+offset chains; the truncation 10k exemption keys on the offset footer only. Paging mechanics untouched.
A single line past the 8MB scan ceiling was truncated to 2000 chars under a continuation footer whose offset skipped the unshown middle. The scan-capped remainder is now windowed like smaller overlong lines, so every scanned byte reassembles through offset continuation.
evaluateSubAgentStop returns null on any tool turn, so the chunked-reads case pinned nothing. Chunk keying stays covered in thrash.test.ts and null-on-tools in the keeps-running test.
Footer-bearing read_file pages already skip the leisure 10k cut so
the 50KB page and its continuation footer reach the reactor. The
always-on size-cap then sliced the first 10k of the body and dropped
Use offset=. Skip that cap for the same pages leisure skips.

Dead offsets on files larger than the 8MB scan ceiling now report
beyond-EOF with the path and valid range. Skip bytes still do not
count against the scan ceiling.
@TheGreatAxios
TheGreatAxios force-pushed the cl-8979-make-large-read_file-responses-explicitly-and-reliably branch from bac09d6 to aa0e05f Compare September 27, 2026 22:39
@TheGreatAxios
TheGreatAxios enabled auto-merge (squash) September 27, 2026 22:40
@TheGreatAxios
TheGreatAxios merged commit 9bd0b9f into main Sep 27, 2026
12 of 13 checks passed
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