Skip to content

Page tool-output blobs by byte windows not line caps - #869

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-7620-page-tool-output-blobs-by-byte-not-by-line
Sep 10, 2026
Merged

Page tool-output blobs by byte windows not line caps#869
TheGreatAxios merged 1 commit into
mainfrom
cl-7620-page-tool-output-blobs-by-byte-not-by-line

Conversation

@TheGreatAxios

@TheGreatAxios TheGreatAxios commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

read_file of a tool-output:// URI pages by byte windows so a single huge line is readable in successive slices. Filesystem reads stay line-oriented. Continuation notices name the URI and the next window.

The old 2,000-line cut fails both shapes of a spilled blob: pretty-printed JSON is thousands of lines, minified JSON is one 100k-character line that the pager cannot scroll.

  • Blob path uses the 50KB content budget with 2000-character wraps instead of the source-file line cap.
  • A giant one-line blob splits into numbered windows; a follow-up read_file of the cursor URI returns the remainder.
  • Ordinary filesystem source files still truncate overlong lines and stop at the default max lines.

Verification

  • bun run typecheck, bun run build, and bun run test pass
  • bun run check passes
  • bun test src/plugins/read-file-guard-plugin.test.ts covers one giant line, a pretty-printed object over the old line cap, and cursor remainder

Fixes CL-7620

A giant one-line spill was truncated at 2000 characters and the rest dropped, so the pager could not continue. Pretty-printed spills hit the source-file line cap even when they fit in the 50KB window. Blob reads now wrap long lines and page on the byte budget, reusing the existing cursor protocol.
@linear-code

linear-code Bot commented Sep 10, 2026

Copy link
Copy Markdown

CL-7620

@TheGreatAxios
TheGreatAxios merged commit 396339a into main Sep 10, 2026
9 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