Repository navigation
fix: Found one narrow regression risk in the new Ollama tool-call name - #74563
vincentkoc merged 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. What this changes: The PR updates Ollama tool-call name normalization to preserve exact registered tool names, only strip provider prefixes when the stripped suffix is allowlisted, and adds stream-runtime regression tests for replay and response conversion. Maintainer follow-up before merge: This is an open implementation PR with a narrow applicable patch; the remaining action is maintainer review and validation, not a separate automated repair job. Security review: Security review cleared: The diff touches tool-name normalization but adds no dependencies, workflow changes, secret handling, or broader execution permissions, and it narrows prefix rewriting when an allowlist is available. Review detailsBest possible solution: Land this allowlist-aware Ollama normalization, or an equivalent maintainer patch, after changed-gate validation so exact registered tool names remain stable while known provider-prefixed names still map to canonical tools. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4b4e0c82e451. |
openclaw#74563) Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
openclaw#74563) Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
openclaw#74563) Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
openclaw#74563) Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
openclaw#74563) Co-authored-by: openclaw-clawsweeper[bot] <280122609+openclaw-clawsweeper[bot]@users.noreply.github.com>
Summary
Found one narrow regression risk in the new Ollama tool-call name normalizer.
What ClawSweeper Is Fixing
tool_/function_tool names before dispatch (regression)extensions/ollama/src/stream.ts:792normalizeOllamaToolCallNameunconditionally strips any leadingfunction,functions,tool, ortoolsfollowed by.,/,_, or-. That means a legitimate tool namedtool_a,tools_invoke_test, orfunction-runis converted toa,invoke_test, orrunin both replay conversion (extensions/ollama/src/stream.ts:771) and response conversion (extensions/ollama/src/stream.ts:887). The same adapter advertises tools to Ollama using the exact registeredtool.name(extensions/ollama/src/stream.ts:845), while OpenClaw docs and prompt construction treat tool names as exact strings (docs/plugins/building-plugins.md:110,src/agents/system-prompt.ts:720). Ollama’s own tool-calling docs also usecall.function.nameas the tool identity that is executed and sent back astool_name. citeturn1view1turn1view0_/-forms or keep normalization limited to the observed provider namespace forms.Expected Repair Surface
extensions/ollama/src/stream.tsextensions/ollama/src/stream-runtime.test.tsSource And Review Context
ClawSweeper report: https://github.com/openclaw/clawsweeper/blob/main/records/openclaw-openclaw/commits/89f871679e8def9aab0d7054f75f807b0e65e548.md
Commit under review: 89f8716
Latest main at intake: eb7d89f
Original commit author: Peter Steinberger
GitHub author: @steipete
Highest severity: low
Review confidence: high
Diff:
f5aebe42e1dbdec61d998486f8d6bfbf548b4159..89f871679e8def9aab0d7054f75f807b0e65e548Changed files:
CHANGELOG.md,extensions/ollama/src/stream.ts,extensions/ollama/src/stream-runtime.test.tsCode read: full changed Ollama stream/test files, Ollama registration path, embedded runner tool-name normalization/allowlist path, plugin tool docs, issue [Bug]: Ollama Kimi tool call fails with "Tool exec not found" despite /tools showing exec #74487 context.
Dependencies/web: official Ollama API/tool-calling docs for
tool_calls.function.name.Expected validation
pnpm check:changedClawSweeper already ran:
pnpm test extensions/ollama/src/stream-runtime.test.ts -- --reporter=verbosepassed: 71 tests.pnpm test src/agents/pi-embedded-runner/run/attempt.test.ts -- --reporter=verbose -t "maps provider-prefixed tool names to allowed canonical tools|normalizes toolUse and functionCall names before dispatch|preserves multi-segment tool suffixes"passed: 3 tests, 124 skipped.node_moduleswas missing; ran onepnpm installper repo instructions, then retried.Known review limits:
ClawSweeper Guardrails
mainbefore changing code.ClawSweeper 🐠 replacement reef notes:
fish notes: model gpt-5.5, reasoning medium; reviewed against b1deca6.