toolrush README

The project's README from github.com/OnlyTerp/toolrush. As one markdown file: README.md.

ToolRush — kill the tool-call tax

shipped and live v2.0 206 tests passed Windows / MSYS

Modern agent models stream tokens faster than their harness can read a file. The bottleneck stopped being tokens/sec — it became the tool-call tax: every read_file, search_files, and terminal call paying process spawns, shell round-trips, wrapper layers, and full re-dispatch for work that costs microseconds.

ToolRush kills the tax. It is a low-overhead execution layer for Hermes Agent: same tools, same output envelopes, same safety gates — radically cheaper transport, plus real batched parallelism and survival across harness updates.

Benchmark bars: stock shell path vs ToolRush v2 on the real installed harness

Results (measured on the real installed harness — no mocks, no fixtures)

Lane Before After Win
Native file reads 255.23 ms 4.44 ms 57.5x
Warm terminal (persistent shell) 285 ms 12.1 ms 23.6x
Search transport (direct rg) 183–455 ms 27–97 ms 4.7–6.8x
Batched parallel RPC 108 ms seq 53 ms batched 2.1x (3.3x controlled overlap)

These are tool-operation wall times, not model-inclusive turn speed — the honest framing: tool-heavy turns get dramatically faster, chat-heavy turns barely move. Full samples, p95s, methodology, and one disclosed regression (trivial native reads don't benefit from threading) in v2/README.md.

Architecture

Five lanes: native read, direct rg transport, warm terminal, batched parallel RPC, update survival

  1. One search engine, accelerated transport. No second, less-correct reimplementation. Direct rg.exe execution preserves real ignore files, regex grammar, context flags, and configuration; native Windows reads reuse the upstream bounded reader, access guards, binary/document routing, and output assembler.
  2. Correctness before speed. Fixed JSON-breaking trailing text in search results; pagination now has stable content order and a more-results sentinel; regex backslashes and leading hyphens stay literal; CRLF and unterminated final lines handled consistently.
  3. Real programmatic parallelism. from hermes_tools import parallel — a batch of 1–16 read operations runs on up to 4 workers through one RPC, returns input order, and keeps authentication, tool allowlists, call budgets, and cell retirement fully enforced. Whole invalid batches are rejected before dispatch. No writes, no terminal.
  4. Correct warm-shell transport. One persistent bash, streaming through an OS pipe with bounded parser memory, a filtered atomic snapshot commit, preserved exit status/cwd/exports, and command-tree kill on cancellation. Never retries a submitted command.
  5. Hardened scheduler admission. Fail-closed classifier refuses hidden writes (wget, curl -o, sed w, branch creation, env-wrapped scripts, shared cwd mutations). Admission is not approval: anything refused still runs — just sequentially, the regular way.
  6. Update survival. Hash-verified helper sources and 25 function-scoped compatibility patches live outside the upstream checkout; after a harness update the plugin restores them in memory, preserving imported references. Unknown upstream drift degrades loudly instead of overwriting new code.
  7. Diagnostics and rollback. doctor.py --smoke, per-lane kill-switches (TOOLRUSH_*=0), a master toolrush.enabled: false, source preimages, payload hashes, and a documented runbook.

Verification

206 passed 5 negative controls live activation verified

Repo layout

Path What
v2/ The shipped implementation — full report, intent recovery, design, MANIFEST (sha256), plugin, installed-source snapshot, evidence
toolrush.py v1 lab runtime (fast_read / batch_read, persistent pool, session cache)
toolrush_search.py · toolrush_exec.py wave-3 in-process search · wave-2 persistent-shell executor
bench_*.py, dissect_*.py the profiling and benchmarking that named the tax
validation-contract*.md VAL- contracts, one per wave (contract-first)
results.md, *.json measured evidence — no invented numbers anywhere

The origin story: lab waves

Before v2 shipped into the live tree, the tax was found and killed one wave at a time in this repo. Kept for the receipts:

Wave Target Result
1 read_file dispatch 1460 ms → 1.18 ms (1237x) — root cause: up to 5 shell commands per read (stat + head|base64 + sed|cut + wc -l + tail); the bytes cost 0.25 ms, the wrapping cost 1460 ms
2 terminal spawn tax echo 285 ms → 12.1 ms (23.6x) via one persistent bash; win decomposed by negative control into ~8x wrap-trim + ~3x shell persistence
3 content search 900 ms → 42 ms (21.3x) in-process walk + memoized real-guard verdicts; match sets identical 40/40
4 dispatch pipeline measured, then STOP — registry 0.005 ms, full path 4.44 ms; the remaining "tax" is load-bearing safety rails. No theater.

Wave 4's verdict is the project's favorite line: know when to stop. v2 then rebuilt the lab wins as production code — one engine, correct semantics, hardened admission, update survival — because a 21x search that drops .gitignore semantics is a bug with a speedup.

Laws


Built for Hermes Agent by Nous Research · shipped and running live since 2026-09-05.

toolrush (OnlyTerp/toolrush)

Searching Database…

这是什么?ToolRush 是 Hermes Agent(Nous Research 的智能体框架)的低开销执行层插件,能消除文件读取、搜索和终端命令等工具调用的延迟开销,同时保持相同的工具、输出和安全闸门。
它是独立工具,还是其他东西的插件?它是一个安装进现有 Hermes Agent 框架并加速其传输层的插件;它刻意不重新实现搜索引擎或文件读取器,而是为真正的实现提速。
安装后我怎么验证它在正常工作?把插件安装进框架后,运行 doctor.py --smoke 进行诊断,还可以通过 TOOLRUSH=0 总开关或 toolrush.enabled 主标志单独禁用任何加速通道。
我需要先安装 Hermes Agent 吗?需要,ToolRush 是只有在已安装的 Hermes Agent 框架内才能工作的插件,其快速搜索通道直接调用 rg.exe(Windows 上的 ripgrep),并复用框架原生的 Windows 文件读取器。
它能加速所有类型的智能体回合吗?不能——提速只作用于工具操作的耗时,而不是整个模型回合,所以工具密集的回合会显著变快,而聊天密集的回合几乎没有变化;琐碎的原生读取也无法从批量读取所用的线程技术中受益。
它是为谁打造的?它专为 Nous Research 开发的 Hermes Agent 框架的用户和运维者打造,并不是通用的工具调用加速器。
ToolRush 能让原生文件读取快多少?原生文件读取从 255.23ms 降到 4.44ms,实测提速 57.5 倍,且是在真实安装的框架上测得,没有使用任何 mock 或测试夹具。
如果一条命令被标记为不适合加速,会发生什么?ToolRush 采用故障关闭式准入分类器,拒绝加速 wget、curl -o 或创建分支等隐蔽写操作,但这些调用仍会执行——只是走正常的较慢串行路径,而不是被拦截。
Hermes Agent 更新后,ToolRush 如何继续正常工作?它把经过哈希校验的辅助源码和 25 个函数级兼容补丁存放在上游检出目录之外,更新后再于内存中恢复它们;如果上游代码意外漂移,它会大声报错降级,而不是悄悄失效。
并行批量读取功能是做什么的?通过 hermestools.parallel,最多 4 个 worker 可在一次 RPC 调用中并行执行 1-16 个读取操作,结果按输入顺序返回,同时仍强制执行身份验证、允许列表和调用预算;无效批次会在分发前被整体拒绝。
Creator
OnlyTerp
Size
0.6 MB
Stars
157
Updated
CommitSep 05
Age
1mo
Commits · 90 Days