Files
Peter Steinberger ce1ca89990 refactor(tool-search): retire tool_search_code in favor of structured search and Code Mode (#159398)
* fix(tool-search): run tool_search_code in the QuickJS sandbox

Tool Search code mode spawned a Node --permission child with a node:vm
guest. Under Bun it needed an installed Node, and without one an explicit
code config silently downgraded to structured tools mode.

Run the guest through the Code Mode executor contract with the bundled
quickjs executor on every runtime. openclaw.tools.search/describe/call use
the shared namespace bridge with lazy thenables; the host admits only those
three operations through ToolSearchRuntime. codeTimeoutMs still bounds the
whole invocation, now including executor preparation. A denied or disabled
code-mode-quickjs plugin fails explicitly with next-step guidance instead of
falling back.

Remove the child source, IPC types, stderr-tail handling, and the Node and
Electron capability probe.

* refactor(tool-search): retire the tool_search_code bridge

Keep structured Tool Search and generic Code Mode as the two large-catalog surfaces. Remove the superseded JavaScript bridge and its runtime, display, and QA paths.

Doctor migrates legacy code mode to tools and removes codeTimeoutMs while preserving activation. toolSearch: true now selects structured search; JavaScript orchestration uses Code Mode exec/wait.

* test(tool-search): cover runtime behavior through structured controls

Exercise retained catalog, policy, hook, cancellation, terminal, MCP and client behavior through structured controls and their runtime owner. Delete bridge-only sandbox and JavaScript envelope cases while preserving nested call-id compatibility.

* test(tool-search): drop retired code mode prompt case

* test: repair fixtures exposed by Tool Search retirement checks

Remove the remaining retired Tool Search mode row. Preserve the session reader owner through the media retention mock and remove an unreachable queued-only branch from the ACP controls/submission fixture.

* test(upgrade-survivor): seed retired Tool Search code mode config

Author the legacy mode and timeout through every supported representative baseline CLI recipe, then require structured search and timeout removal after candidate update and Doctor. Existing config validation proves the resulting effective config.

Include the diagnostics native assignment summary in frozen target staging; the required assertion suite exposed its missing import. Node recipe and assertion tests: 238 passed, 157.87s wall. Docker validation remains with the coordinator.

* refactor(tool-search): drop the retired code-mode recovery surface

* chore: shrink assertion baseline after Tool Search retirement

* test(tool-search): drop the unused Tool Search test API

* chore: drop the retired Tool Search test API assertion baseline

* fix(e2e): drop duplicate native assignment staging line

Main now stages native-assignment-summary.mjs for frozen upgrades itself; the branch copy from the Tool Search upgrade proof became a duplicate after merging.

* build(pr): list Tool Search migration in wrapper inventory

The scripts/pr wrapper loads the Doctor config migrations at runtime, so the new Tool Search retirement migration belongs in its extracted component inventory.

* test(e2e): ship the Tool Search recipe to prepared tooling workers

Prepared tooling workers copy only listed source-relative assets, while the
upgrade survivor config recipe reads every section file by name at import.
The new tools-tool-search.json was missing, so the Docker scheduler parent
signal test's runner died with ENOENT and its polling wait reported a generic
5 s timeout that looked like a flake.

List the asset, guard the recipe directory against the preserved list, and
make the scheduler readiness wait fail with the runner's stderr once it exits.
2026-09-27 16:08:37 -07:00
..