Why this matters
The 638k-token read death was size-blind chunking: the model had no way to know the file was 542KB before paging into it. kimi-code's answer (refs/kimicode/kimi-code packages/agent-core-v2/src/workspace/workspaceFs/fs.ts:105-124) makes every read self-describing: offset+length (default window 1 MiB, hard max 10 MiB) and a response that ALWAYS carries size, truncated, line_count. The size field is the subtle killer feature — the model learns the true file size up front and stops chunk-blind paging.
Design
- The child-facing read tool gains
offset/length paging with a 1 MiB default window and 10 MiB hard max.
- Every read response carries
size, truncated, line_count (schema'd, kimi pattern).
- Ship ripgrep (
runRg.ts in kimi's tree is the reference) as a first-class sibling tool so grep-before-read is mechanical, not prompted.
Acceptance criteria
Related
Why this matters
The 638k-token read death was size-blind chunking: the model had no way to know the file was 542KB before paging into it. kimi-code's answer (refs/kimicode/kimi-code
packages/agent-core-v2/src/workspace/workspaceFs/fs.ts:105-124) makes every read self-describing:offset+length(default window 1 MiB, hard max 10 MiB) and a response that ALWAYS carriessize,truncated,line_count. Thesizefield is the subtle killer feature — the model learns the true file size up front and stops chunk-blind paging.Design
offset/lengthpaging with a 1 MiB default window and 10 MiB hard max.size,truncated,line_count(schema'd, kimi pattern).runRg.tsin kimi's tree is the reference) as a first-class sibling tool so grep-before-read is mechanical, not prompted.Acceptance criteria
size+truncated: true, never the whole fileRelated