Bounds outline batch processing and edit matching so large requests no longer spend unbounded time parsing, searching, or diffing.
Outline batches
Multi-file and directory outlines reuse cached parse results on repeat calls and stop parsing once the reply is full.
files lists are capped at 200; entries past the cap are never probed, read, or parsed and count in the footer as unshown.
Batches stop near the request deadline and return a partial result marked with the time-limit reason.
When the deadline footer does not fit, taking back the last shown file keeps its path in the read manifest if an earlier block for the same path is still shown, so hosts' read rules see every displayed file.
Edit matching and logging
Whitespace-reflow match search for edits and patches is now linear, with the spacing check folded into the scan itself, so a failed edit with very large or repetitive match text no longer takes seconds.
Edit diff building has a 1-second timeout; beyond it a coarser but still correct diff is returned.
Slow tool-call log lines now record a content-free argument shape and per-step edit phase times, without ever logging paths, edit text, or credentials.
Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues remain.
Summary
The PR bounds outline batches, speeds up whitespace-reflow searches, limits diff-building time, and adds content-free slow-call details.
Outline batches stop before they do work that cannot reach the reply.
Edit and patch searches find reflowed text with one linear scan.
Edit replies switch to a coarser diff when refinement takes too long.
Slow-call logs show request shape and edit phase times.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Outline request] --> B[Cap and order files]
B --> C{Deadline near?}
C -->|Yes| G[Return partial outline]
C -->|No| D[Reuse cached facts or parse]
D --> E{Next file fits?}
E -->|Yes| C
E -->|No| G
G --> H[Add footer and read manifest]