[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-95972":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":19,"hasPages":19,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":15,"starSnapshotCount":15,"syncStatus":25,"lastSyncTime":26,"discoverSource":27},95972,"toolrush","OnlyTerp\u002Ftoolrush","OnlyTerp","Kill the tool-call tax: harness tool latency back below model TPS. Fast local lanes, persistent pools, session caches. Scratch lab turned real.",null,"Python",150,9,101,1,0,49,3,"MIT License",false,"main",[],"2026-09-21 02:04:29","\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fassets\u002Fhero.svg\" alt=\"ToolRush — kill the tool-call tax\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"#the-problem\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fstatus-shipped%20%26%20live-22c55e?style=flat-square\" alt=\"shipped and live\"\u002F>\u003C\u002Fa>\n  \u003Ca href=\"v2\u002FREADME.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fversion-2.0-f97316?style=flat-square\" alt=\"v2.0\"\u002F>\u003C\u002Fa>\n  \u003Ca href=\"v2\u002Fevidence\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Ftests-206%20passed-4ade80?style=flat-square\" alt=\"206 tests passed\"\u002F>\u003C\u002Fa>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fplatform-Windows%20%2F%20MSYS-38bdf8?style=flat-square\" alt=\"Windows \u002F MSYS\"\u002F>\n\u003C\u002Fp>\n\nModern agent models stream tokens faster than their harness can read a file. The bottleneck stopped being tokens\u002Fsec — 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.\n\n**ToolRush kills the tax.** It is a low-overhead execution layer for [Hermes Agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent): same tools, same output envelopes, same safety gates — radically cheaper transport, plus real batched parallelism and survival across harness updates.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fassets\u002Fbenchmarks.svg\" alt=\"Benchmark bars: stock shell path vs ToolRush v2 on the real installed harness\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n## Results (measured on the real installed harness — no mocks, no fixtures)\n\n| Lane | Before | After | Win |\n|---|---:|---:|---:|\n| **Native file reads** | 255.23 ms | 4.44 ms | **57.5x** |\n| **Warm terminal** (persistent shell) | 285 ms | 12.1 ms | **23.6x** |\n| **Search transport** (direct `rg`) | 183–455 ms | 27–97 ms | **4.7–6.8x** |\n| **Batched parallel RPC** | 108 ms seq | 53 ms batched | **2.1x** (3.3x controlled overlap) |\n\nThese 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\u002FREADME.md`](v2\u002FREADME.md).\n\n## Architecture\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"docs\u002Fassets\u002Farchitecture.svg\" alt=\"Five lanes: native read, direct rg transport, warm terminal, batched parallel RPC, update survival\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n1. **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\u002Fdocument routing, and output assembler.\n2. **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.\n3. **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.\n4. **Correct warm-shell transport.** One persistent bash, streaming through an OS pipe with bounded parser memory, a filtered **atomic** snapshot commit, preserved exit status\u002Fcwd\u002Fexports, and command-tree kill on cancellation. Never retries a submitted command.\n5. **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.\n6. **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.\n7. **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.\n\n## Verification\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fregression-206%20passed%20%C2%B7%200%20failed%20%C2%B7%200%20skipped-4ade80?style=for-the-badge&logo=pytest&logoColor=white\" alt=\"206 passed\"\u002F>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fnegative%20controls-5%20fail%20on%20revert-f97316?style=for-the-badge\" alt=\"5 negative controls\"\u002F>\n  \u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flive%20activation-verified%20in%20running%20kernel-38bdf8?style=for-the-badge\" alt=\"live activation verified\"\u002F>\n\u003C\u002Fp>\n\n- **206 unique regression cases passed**, zero failed, zero skipped (deduplicated across three suites).\n- **Five negative controls** each fail for the intended reason when the fix is reverted — native read off, native search off, parallel workers serialized, unsafe admission restored, snapshot commit removed. A test that can't fail proves nothing.\n- **Failure SETS, not counts**, compared against a 441-collected baseline sweep: identical failing IDs before and after.\n- **Live end-to-end activation**: gateway and desktop restarted clean; `parallel` RPC exercised inside the real running `execute_code` kernel; config and provider files verified byte-identical (SHA-256) across the restart.\n- Contract verdicts, evidence XMLs, raw benchmark samples, reviewer reports: [`v2\u002Fevidence\u002F`](v2\u002Fevidence\u002F).\n\n## Repo layout\n\n| Path | What |\n|---|---|\n| [`v2\u002F`](v2\u002FREADME.md) | **The shipped implementation** — full report, intent recovery, design, MANIFEST (sha256), plugin, installed-source snapshot, evidence |\n| [`toolrush.py`](toolrush.py) | v1 lab runtime (fast_read \u002F batch_read, persistent pool, session cache) |\n| [`toolrush_search.py`](toolrush_search.py) · [`toolrush_exec.py`](toolrush_exec.py) | wave-3 in-process search · wave-2 persistent-shell executor |\n| `bench_*.py`, `dissect_*.py` | the profiling and benchmarking that named the tax |\n| `validation-contract*.md` | VAL- contracts, one per wave (contract-first) |\n| `results.md`, `*.json` | measured evidence — no invented numbers anywhere |\n\n## The origin story: lab waves\n\nBefore v2 shipped into the live tree, the tax was found and killed one wave at a time in this repo. Kept for the receipts:\n\n| Wave | Target | Result |\n|---|---|---|\n| **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 |\n| **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 |\n| **3** | content search | 900 ms → 42 ms (**21.3x**) in-process walk + memoized real-guard verdicts; match sets identical 40\u002F40 |\n| **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. |\n\nWave 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.\n\n## Laws\n\n- Contract before code. Negative control or it didn't happen.\n- Live harness trees are never touched from the lab — prototype wins first, then ports behind a kill-switch.\n- Byte-identical output vs the stock path, or the lane doesn't ship.\n- Fail-closed everywhere: refused acceleration still executes, just the safe sequential way.\n- Measured evidence in-repo; no invented numbers, ever.\n\n---\n\nBuilt for [Hermes Agent](https:\u002F\u002Fgithub.com\u002FNousResearch\u002Fhermes-agent) by Nous Research · shipped and running live since 2026-09-05.\n","ToolRush 是一个专为 AI 代理（Agent）设计的低开销工具调用执行层，旨在显著降低工具调用延迟（即“tool-call tax”）。它通过本地快速通道、持久化进程池和会话级缓存等机制，优化文件读取、终端交互、代码搜索（rg）等高频工具操作，实测提速达5–57倍；保持与 Hermes Agent 兼容的接口与安全约束，支持 Windows\u002FMSYS 平台。适用于工具密集型 AI 代理场景，如本地代码助手、IDE 插件、离线开发代理等对响应延迟敏感的部署。",2,"2026-09-07 02:30:07","CREATED_QUERY"]