Repository navigation
fix: Tool Search uses one dispatcher name across providers - #169552
Conversation
Rename the generic dispatcher to dispatch_action and retain read-only historical display plus shipped policy and hook matching. Keep Ollama wire aliases only for directly advertised names that collide with its parser envelopes. Preserve tool_call invocation IDs and event contracts. Builds on #167933 and the local web-tool report from @lator57-gif in #145137.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs changes before merge. What this changesThis PR renames the generic Tool Search dispatcher to dispatch_action while preserving historical display, policy, and hook compatibility. Example: Qwen3:8b searches for a web tool and invokes it through native Ollama.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open: it makes a coherent dispatcher cutover with preserved compatibility and no identified introduced defect; current-head CI failures still need attribution. Priority: P2 Before merge
FindingsNone. Agent review detailsHow this fits togetherTool Search compacts authorized core, plugin, MCP, and client tools into a catalog; provider-facing controls discover entries and dispatch calls through their existing execution owners. flowchart LR
A[Authorized tools] --> B[Tool Search catalog]
B --> C[Provider tool declarations]
C --> D[Model call]
D --> E[dispatch_action]
E --> F[Target execution owner]
F --> G[Result and transcript]
Technical reviewBest possible solution: Use one generic dispatcher name, retain shipped policy and transcript compatibility, and keep parser aliases confined to the Ollama transport. Do we have a high-confidence way to reproduce the issue? Source establishes the prompt/wire spelling mismatch and Ollama's envelope-sensitive parser; supplied live runs exercise the replacement, while the reported baseline echo also succeeds with the existing adapter. Is this the best way to solve the issue? The shared rename removes dispatcher-specific transport rewriting and preserves the existing execution owner, with narrower aliases retained for direct names that still collide. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7c1c689bfcac. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfacePR surface statistics unavailable: the file list is incomplete. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed October 12, 2026, 8:00 PM ET / October 13, 2026, 00:00 UTC (Revision 8). |
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…169552) * fix: Tool Search uses one dispatcher name across providers Rename the generic dispatcher to dispatch_action and retain read-only historical display plus shipped policy and hook matching. Keep Ollama wire aliases only for directly advertised names that collide with its parser envelopes. Preserve tool_call invocation IDs and event contracts. Builds on openclaw#167933 and the local web-tool report from @lator57-gif in openclaw#145137. * fix: preserve legacy dispatcher replay beside direct call tools * test: align sorted allowlists with the dispatcher name
Related: #145137. Builds on #167933; thanks to @lator57-gif for the local-model report.
What Problem This Solves
Ollama's parser confuses the generic
tool_calldispatcher with chat-template markers, while its wire alias introduces a second name that small models can mix up.User Impact
Generic Tool Search now uses
dispatch_actionconsistently across providers. Update custom instructions to use that name with the existingidandargsshape. Completedtool_callhistory remains readable and displays the target tool without rewriting stored transcripts. Existing literal and wildcard policies and literal hook matchers remain effective; hook/event fields andtool_call:invocation IDs are unchanged. Codex keeps its native tool surface.Direct Ollama names that still collide with parser envelopes, such as
ls,name, andfunction, retain wire aliases. The dispatcher-specific description rewriting and historical alias allocation are removed. This does not change security defaults, configure web search, or expose deferred web tools directly; that is a separate follow-up.Why This Change Was Made
One canonical dispatcher spelling removes the prompt/wire mismatch. The remaining adapter covers only advertised colliding names, including their selectors and streamed results. Historical names reserve the alias namespace without becoming new aliases; the shipped dispatcher is preserved before function-prefix normalization, including beside a direct tool named
call.Evidence
Native Ollama 0.40.2,
qwen3:8b, through realpnpm openclaw --profile <isolated-profile> agent --local:Use exec to run echo hello and report the actual stdout. Do not answer from memory.hello; dispatcher offered asopenclaw_tool_callhello;dispatch_actionoffered directly, no dispatcher aliastool_search→dispatch_actionsearch →dispatch_actionfetchOllama, native endpoint/api/chat; zero tool failuresweb-aftertranscript continuation, fetchhttps://example.comtool_search, tool_call, tool_call; current declarations useddispatch_action; returnedExample DomainThe copied schema-25 profile first refused admission with explicit Doctor guidance.
doctor --fix --yes --non-interactivemigrated the copy to schema 26; original database bytes stayed unchanged. The subsequent real continuation supplied the old tool names unchanged to Ollama. No transcript-name migration was added here.security auditstill reportsmodels.small_params;security audit --fixchanged neither configuration bytes nor the tools policy. This advisory finding is not a runtime model block.The first cold CLI attempt exceeded the former 180-second process allowance before any model request; it is excluded from model results. Launch allowance is now 720 seconds, with the agent deadline still 120 seconds. The matched echo captures report 8,199 initial native prompt tokens on main and 8,205 here (+6); different worktree paths and bounded skill-description truncation also affect those bytes. There is no claim of material prompt savings.
tool_callbeing rewritten toopenclaw_call, then passed after the correction.sessionFile/SessionEntryCoretype error.f63c37a3fff9ef37e78600b102f4925761acfa8e.Runtime production +51/-54 (net -3); QA/scripts +35/-29 (net +6); tests/test support +282/-243; docs +38/-28. Counting every non-test code path, this is +86/-83 (net +3). The alias cleanup pays for runtime compatibility; the remaining growth is the QA/tooling cutover and formatter wrapping for the longer canonical name. No changelog edit.
CI follow-up
The first exact-head CI exposed two sorted allowlist expectations that retained the dispatcher's old alphabetical position. The follow-up changes only those two expectations; all six owner tests pass (316.03 s runner wall, dominated by cold transforms). Production code and the model payload construction used for live proof are unchanged. Autoreview is clean again through P2; the runtime rebuild passed (3m 27.3s).
First CI merge
2b136b9300e27591c39ceb8214fae56b987d96d3used main base00809bf2c2a0f9a154f57c76909b7457a058af29. Independent base-only reproductions:agent-tools.model-provider-collision.test.ts, unauthenticated direct Codex searchweb_searchassertion; 1 failed/6 passed, 159.88 s process walleager-import-closure.test.tssettled-turn-finalizer.native.test.tsSessionTranscriptWriterClaimReboundErrorfailures; 4 failed/5 passed, 245.63 sgateway-widget-restart.e2e.test.tsgateway-workshop-learning.e2e.test.ts💾 Learned:assertion on Linux base; macOS instead reached its test deadlineLinux proof used the default Blacksmith Testbox through the repository wrapper:
tbx_01m4q8twrz1hw72ena6tpgsxty, run. The payload verified the exact base tree before execution. The owned lease stopped after the run.The separate
skill-library-worker-wire.e2e.test.tsplacement-authority failure at the replacement turn after cancellation did not reproduce on that base on macOS (passed, 291.70 s) or Linux (passed, 75.49 s runner wall). The changed provider fixture contains no remaining dispatcher-name mismatch; the rejection is in placement admission before model/tool dispatch. This prior CI failure remains investigated but unresolved; no repair or passing replay is claimed as a fix. The new head must still complete CI.Final-head checks
At
f63c37a3fff9ef37e78600b102f4925761acfa8e, CI has 95 successful jobs and these remaining failures (the aggregateopenclaw/ci-gateis consequently red):💾 Learned:assertion, reproduced on the CI main base in the Linux run above.NodeRuntimeAgentSelectionTest.removedAgentFallsBackToGatewayDefaultAfterReconnect, expected the device-owned main key but observedmainimmediately after reconnect/agent refresh. The tested merge is05bdd103d66f50c053c503a13322b010696e4134, with main parent1c20c58fbf79935d6e2254b4ce13e1b37891c4c4. Its failing test,NodeRuntime.kt, andChatController.ktare blob-identical to that parent. This fixture supplies no tool-call content to the changed display helper, and the failure occurs in session selection, before tool display. This is same-base source/causal attribution, not a claim that a baseline Android run was executed. The earlier head's identical Android changes passed third-party tests; Play, Wear, native access, and ktlint also pass on this head. No retry is claimed as a repair.The earlier search-route, closure, finalizer, and worker-placement failures are absent from this run. The placement failure remains a recorded prior-run uncertainty, not a claimed fix.
ClawSweeper reviewed this exact head with no findings and no Before merge items; live proof is sufficient. Nothing is merged.