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
read_file should support a byte/line window (start / limit or equivalent) and must not dump a huge file into the model when no window is given.
Today: full file up to 16 MiB, then TOOL_RESULT_MAX_CHARS flatten. Large sources blow the turn; the model re-reads them next turn anyway because we drop tool_run (#549 — different issue).
Goal
Args: existing path + window (line start/limitor byte range — pick one in plan, name the cap).
Over a size/line threshold and no window: return {truncated/summarized, line_count or bytes, hint: request a window} — not the body.
Optional later: language-agnostic outline. Do not ship Orrery’s Go-only func/type/package heuristic.
Successful windowed read still counts as a full-enough grant for str_replaceonly if we can define that honestly (or require a full read for edit — lock in plan). Do not silently weaken read-before-edit (plan: agent read-before-edit + external file freshness (parent) #277).
Success: reading ui.zig does not inject 1400 lines unless the model asked for a slice.
Constraints
Jail / cwd / in-jail abs unchanged.
finalize / TOOL_RESULT_MAX_CHARS still apply to the window.
Truncated-without-window must not authorize overwrite (freshness.recordRead(..., truncated: true) already exists).
Caps: NEW window default + “too big” threshold in create-plan.
Summary
read_fileshould support a byte/line window (start/limitor equivalent) and must not dump a huge file into the model when no window is given.Today: full file up to 16 MiB, then
TOOL_RESULT_MAX_CHARSflatten. Large sources blow the turn; the model re-reads them next turn anyway because we droptool_run(#549 — different issue).Goal
path+ window (linestart/limitor byte range — pick one in plan, name the cap).{truncated/summarized, line_count or bytes, hint: request a window}— not the body.func/type/packageheuristic.str_replaceonly if we can define that honestly (or require a full read for edit — lock in plan). Do not silently weaken read-before-edit (plan: agent read-before-edit + external file freshness (parent) #277).Success: reading
ui.zigdoes not inject 1400 lines unless the model asked for a slice.Constraints
finalize/TOOL_RESULT_MAX_CHARSstill apply to the window.freshness.recordRead(..., truncated: true)already exists).create-plan.Non-goals
list_dirintoread(our split is fine)Related
read_fileinlib/agent/tools.tssearch(hits → windowed read)str_replacewindowSuggested next
create-planafter #562’s result shape so search hits and read windows use the same line addressing.