Runner: normalize malformed tool call names before dispatch#39328
Runner: normalize malformed tool call names before dispatch#39328vincentkoc merged 3 commits intomainfrom
Conversation
Greptile SummaryThis PR fixes a class of Key changes:
Note: While the test at line 307 is titled "normalizes toolUse and functionCall names before dispatch," it currently only exercises whitespace trimming for those block types, not prefix-stripping normalization. Consider expanding that test with an Confidence Score: 4/5
Last reviewed commit: 00dd796 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00dd7963a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26f5184646
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (let index = 1; index < segments.length; index += 1) { | ||
| const suffix = segments.slice(index).join("."); | ||
| candidateNames.add(suffix); |
There was a problem hiding this comment.
Restrict suffix fallback to known provider prefixes
Building candidates from every dotted/slashed suffix can remap arbitrary namespaced tool calls to unrelated allowed tools. For example, if only search is allowed, a model output like calendar.search will now normalize to search and execute it instead of failing with tool-not-found as before. That is a behavior regression introduced here and can cause unintended side effects when models emit non-provider namespaces; this fallback should be limited to known provider prefixes (e.g. functions. / tools/) rather than dropping any leading segment(s).
Useful? React with 👍 / 👎.
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
…#39328) * Runner: normalize malformed tool call names before dispatch * Runner: tighten prefixed tool name normalization
(cherry picked from commit 2ec478c)
(cherry picked from commit 5b30c9d)
…r live test fixes (#1795) * Changelog: credit openclaw#39328 to @vincentkoc (cherry picked from commit 2ec478c) * Changelog: move openclaw#39328 credit to section end (cherry picked from commit 5b30c9d) * Pi Runner: gate parallel_tool_calls to compatible APIs (openclaw#39356) * Pi Runner: gate parallel_tool_calls payload injection * Pi Runner: cover parallel_tool_calls alias precedence * Changelog: note parallel_tool_calls compatibility fix * Update CHANGELOG.md * Pi Runner: clarify null parallel_tool_calls override logging (cherry picked from commit daecd2d) # Conflicts: # CHANGELOG.md # src/agents/pi-embedded-runner-extraparams.test.ts # src/agents/pi-embedded-runner/extra-params.ts * docs: add changelog for Telegram DM draft restore (openclaw#39398) (cherry picked from commit 722c5e5) * fix: document discord agentComponents schema parity (openclaw#39378) (thanks @gambletan) (openclaw#39378) Co-authored-by: Shadow <[email protected]> (cherry picked from commit 9c8e34d) * fix: land openclaw#39337 by @goodspeed-apps for acpx MCP bootstrap Co-authored-by: Goodspeed App Studio <[email protected]> (cherry picked from commit 5659d7f) # Conflicts: # extensions/acpx/openclaw.plugin.json # extensions/acpx/src/config.test.ts # extensions/acpx/src/config.ts # extensions/acpx/src/runtime-internals/test-fixtures.ts # extensions/acpx/src/runtime.test.ts # extensions/acpx/src/runtime.ts # extensions/acpx/src/service.ts * docs: clean up latest changelog sections (cherry picked from commit c743fd9) * fix: land contributor PR openclaw#39516 from @Imhermes1 macOS app/chat/browser/cron/permissions fixes. Co-authored-by: ImHermes1 <[email protected]> (cherry picked from commit d15b6af) # Conflicts: # CHANGELOG.md # apps/macos/Sources/RemoteClaw/NodeMode/MacNodeBrowserProxy.swift # apps/macos/Sources/RemoteClaw/NodeMode/MacNodeModeCoordinator.swift # apps/macos/Sources/RemoteClaw/NodeMode/MacNodeRuntime.swift # apps/macos/Sources/RemoteClaw/PermissionsSettings.swift # apps/macos/Tests/RemoteClawIPCTests/MacNodeBrowserProxyTests.swift # apps/shared/RemoteClawKit/Sources/RemoteClawChatUI/ChatView.swift # apps/shared/RemoteClawKit/Sources/RemoteClawKit/BrowserCommands.swift # apps/shared/RemoteClawKit/Tests/RemoteClawKitTests/ChatComposerPasteSupportTests.swift * fix: stage docker live tests from mounted source (cherry picked from commit 21df014) * fix: add minimal process shim for acpx mcp-agent-command The upstream process.ts depends on gutted runtime-api, so provide a minimal spawnAndCollect implementation that satisfies the import. --------- Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: gambletan <[email protected]> Co-authored-by: Shadow <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Summary
Tool not foundfailures.functions.readortools/execstill fail before dispatch.toolCall,toolUse, andfunctionCallblocks.parallel_tool_callscompatibility, or the already-fixed onboardingtools.profileregression path.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Malformed but recoverable tool names such as
functions.readandtools/execnow normalize to the underlying canonical tool when that tool is allowed. Alternate tool-call block types (toolUse,functionCall) now get the same pre-dispatch normalization path astoolCall.Security Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
functions.readortools/execthroughwrapStreamFnTrimToolCallNames(...)with canonical tools allowed.toolUse/functionCallblocks with padded tool names through the same path.Expected
Actual
toolUse/functionCallnames were not normalized in the same way astoolCallEvidence
Human Verification (required)
What you personally verified (not just CI), and how:
pnpm vitest run src/agents/pi-embedded-runner/run/attempt.test.ts;pnpm check src/agents/pi-embedded-runner/run/attempt.ts src/agents/pi-embedded-runner/run/attempt.test.tsCompatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
52274526acsrc/agents/pi-embedded-runner/run/attempt.ts,src/agents/pi-embedded-runner/run/attempt.test.tstoolCallRisks and Mitigations