Repository navigation
fix(tool-search): skip catalog rebuild when tool set is unchanged - #87172
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 27, 2026, 3:55 PM ET / 19:55 UTC. Summary PR surface: Source +204, Tests +144. Total +348 across 3 files. Reproducibility: yes. from source and reporter logs, though I did not run a live embedded session. Current main unconditionally registers the compact catalog on the enabled path, and the linked report includes repeated embedded-run catalog log lines. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance: Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Make reuse stable across equivalent embedded-run tool sets while rebinding fresh hook/session/run context, then prove it with Do we have a high-confidence way to reproduce the issue? Yes, from source and reporter logs, though I did not run a live embedded session. Current main unconditionally registers the compact catalog on the enabled path, and the linked report includes repeated embedded-run catalog log lines. Is this the best way to solve the issue? No. The PR fingerprints wrapped catalog tool object identity, while embedded attempts use per-run wrapped tools, so the advertised cross-run reuse path does not cover the reported behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 74f9d6b96d48. Label changesLabel justifications:
Evidence reviewedPR surface: Source +204, Tests +144. Total +348 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
c7ba718 to
5733039
Compare
abda6f6 to
861bad8
Compare
Reuse active Tool Search catalogs only when the full catalog-affecting fingerprint matches, and restore cached entries into the current run binding after cleanup. Suppress repeated catalog logs only for real reuse. Also fixes an existing lint issue in the session store clone helper so the changed core gate can pass on latest main. Closes openclaw#86887 Co-authored-by: Sebastien Tardif <[email protected]>
861bad8 to
6bfc125
Compare
Summary
Fixes the repeated Tool Search catalog work reported in #86887. Embedded agent runs now mark Tool Search catalog reuse only when the active catalog is actually reused or restored for the current run binding.
The rewrite keeps run-scoped active catalogs intact while adding a bounded session-level reusable snapshot for unchanged tool sets after run cleanup. Reuse is guarded by a full catalog-affecting fingerprint: id/source/name/label/description, parameters, and executable tool identity. When reuse happens, the current
catalogRefand all current lookup aliases are bound before returning, so later Tool Search resolution still works.Changes:
catalogReusedfrom the shared Tool Search compaction path.clearToolSearchCatalogfrom a bounded session snapshot.Closes #86887
Verification
pnpm test src/agents/tool-search.test.ts -- --reporter=verbosepnpm check:changedtbx_01ksney4f00wgk9n39yv7jsh4m, exit 0.git merge-tree --write-tree origin/main HEADf82ca88ddcfc695a8d631d569a92590900999f1d.$autoreviewautoreview clean: no accepted/actionable findings reported.Real behavior proof
Behavior addressed: repeated embedded-agent Tool Search catalog registration/logging for unchanged effective tool sets.
Real environment tested: local OpenClaw source checkout on macOS, running the actual Tool Search source module with Node and the repo runtime loader.
Exact steps or command run after this patch:
node --import tsx --input-type=module -e 'import { applyToolSearchCatalog, clearToolSearchCatalog, createToolSearchTools, TOOL_SEARCH_CODE_MODE_TOOL_NAME } from "./src/agents/tool-search.ts"; /* constructs one OpenClaw Tool Search catalog, clears the run, reapplies the same tools, then calls a target through tool_search_code */'Evidence after fix: terminal output from that OpenClaw runtime path:
Observed result after fix: the first run registers the compact catalog, run cleanup does not destroy the reusable snapshot, the second run restores it with
catalogReused=true, andtool_search_codestill dispatches to the restored target catalog.What was not tested: no live Matrix gateway delivery; this proof exercises the OpenClaw Tool Search runtime path that owns catalog registration/reuse and target dispatch.