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
fix(search): bound glob/grep tree-walk with cooperative + watchdog timeout (#201)
A Glob over a path containing a network mount (rclone/OSS NFS) hung the
agent loop forever: the single-threaded walker exhaustively traversed the
whole tree for a zero-match pattern with no deadline, blocking the
spawn_blocking thread that the agent loop awaits.
Two-layer fix:
- Inner cooperative deadline (ResourceLimits::walk_timeout, 30s) checked
between walk entries; returns partial results + timed_out so the tool can
tell the LLM to narrow `path`.
- Outer hard floor via the runtime per-tool watchdog, now extended from
Bash-only to all fs-read tools (Glob/Grep/Ls/Read/ReadPdf/ReadImage/
ReadHtml) with a typed StaleReason.
The watchdog is applied at a single convergence point
(execute_tool_watchdogged) that BOTH the streaming early-start path and the
normal approval path route through, so a tool can never be bounded on one
path and unbounded on the other.
Also: parallelize the glob walker (mirrors grep's build_parallel), default
follow_links to false (ripgrep parity, avoids cross-mount escape/cycles),
decouple `truncated` from the timeout signal (no spurious overflow files),
add a deterministic path tiebreak to glob output, dedup the timeout notice
into loopal-tool-api, and clamp search `max` to >=1.
Design notes under design/glob-traversal-hang/.
0 commit comments