You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a7a8635
Browse filesBrowse the repository at this point in the historyBrowse files
feat(read-file): page large read_file responses through to the end
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.
// Headroom reserved out of the byte budget for the continuation notice, so the
30
-
// returned payload including the notice stays under READ_FILE_MAX_BYTES.
31
-
constNOTICE_RESERVE_BYTES=256;
33
+
// returned payload including the notice stays under READ_FILE_MAX_BYTES. Sized
34
+
// for a dual footer: the plain `Use offset=` continuation plus the appended
35
+
// single-use cursor alias on byte/scan-limit pages.
36
+
constNOTICE_RESERVE_BYTES=384;
32
37
33
38
constLINE_TRUNC_SUFFIX=` ... [line truncated at ${READ_FILE_MAX_LINE_LENGTH} chars; full line remains in the file — use grep to match within the line]`;
34
39
constTOOL_OUTPUT_CHUNK_BYTES=64*1024;
@@ -81,6 +86,13 @@ function mapFilesystemStreamError(
81
86
* When `wrapLongLines` is set, overlong lines are split into successive numbered
82
87
* windows instead of being truncated and dropped — so a giant JSON line can be
83
88
* paged through with the same offset protocol as a multi-line file.
89
+
* When `windowHugeLines` is set instead, only single lines that on their own
90
+
* exceed the output budget are windowed; ordinary lines keep their numbers, so
"Read a file and return its content with line numbers. The path argument accepts either a filesystem path or a tool-output URI of the form tool-output:///{callId} that references a prior tool result.",
45
+
"Read a file and return its content with line numbers. The path argument accepts either a filesystem path or a tool-output URI of the form tool-output:///{callId} that references a prior tool result. Large files are returned one page at a time: pass offset and limit to page through the file, then follow the `Use offset=N to continue.` footer to read the next page through to the end.",
0 commit comments