Repository navigation
fix(agent-runtime): reject differing spellings of one tool argument - #2642
Conversation
Calls in #2552 stored conversational junk in `path` ("Wizard.tsx here?", "Wizard.tsx:{") next to a clean `file_path`. D273 let the canonical name win when both arrived, so every retry ran the junk path and host-core never saw the clean value. Picking either spelling is a guess, so a call whose spellings disagree now fails with INVALID_ARGUMENT before the write lock and host call, quoting each value so the next call can send one. Identical values still fold to one argument. The alias map and its validation move from runtime.ts into tool-param-aliases.ts, shrinking the hotspot. Spec 03 and D690 record the amendment to D273. fixes #2552
Deploying pi-desktop with
|
| Latest commit: |
477b82b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://329ba897.pi-desktop.pages.dev |
| Branch Preview URL: | https://fix-tool-path-alias-conflict.pi-desktop.pages.dev |
|
I independently checked this on The runtime change addresses that confirmed conflict, but the PR should not automatically close #2552. The reported The first Windows Host E2E attempt failed when the visualization fork fixture timed out waiting for Bash. That log does not establish whether the failure is transient. This is not an approval; the refreshed check results and required candidate validation still need to be confirmed before merging. |
Ported from vastsa/PI-Desktop v0.24.0-beta.7 (bug fixes only; the release's features were left for a later rebase): vastsa#2625 quarantine rejected outbox appends instead of retrying them forever vastsa#2574 settle live turns and tool rows when the sidecar dies mid-stream vastsa#2578 native Pi turns stay stoppable after a reload vastsa#2634 the task badge mirrors work that is still running vastsa#2639 let Arabic and Hebrew paragraphs choose their own side vastsa#2640 stop a renderer crash loop with one GPU-less relaunch, then a dialog vastsa#2642 reject differing spellings of one tool argument vastsa#2655 compaction summaries open on demand in the transcript
Fixes #2552.
Root cause
Every malformed call the reporter recovered carried junk in
pathand the clean value in an alias:{ "path": "src/pages/Wizard.tsx here?", "file_path": "src/pages/Wizard.tsx" } { "path": "src/pages/Wizard.tsx:{", "file_path": "src/pages/Wizard.tsx" }normalizeToolParamslet the canonical name win when both arrived (D273). It dropped the cleanfile_pathand ran the junk path on every retry, so host-core never saw the value the model also sent. Both fields are in the schema, so models fill both.Fix
A call that names one argument under several accepted spellings with different values now fails with
INVALID_ARGUMENTbefore the write lock and the host call. The message quotes each value and asks forpathalone:Read/Write/Edit/BrowserPreview(path) andGlob/Grep(pattern), including two aliases without the canonical name.executeandpreparePathToolCall).normalizeToolParamsstays non-throwing because the batch planner calls it too.runtime.tsintotool-param-aliases.ts, so the hotspot shrinks by 49 LOC.pathfirst, which is how those calls ran.03-runtime/03-tools-and-permissions.mdand decision D690 (amends D273) record the change.The malformed Edit tags (
9DA2 nope?) are a separate symptom. They already fail withEDIT_TAG_REQUIREDand are not changed here. Where the suffixes originate (model, endpoint, or stream assembly) is still unknown.Verification
Base
origin/main09400b27c, macOS arm64.packages/agent-runtimevitest: 146 files / 2181 tests pass. The alias test now covers:Readwith the reporter'shere?shape: rejected, and the message quotes both valuesEditwith:{: rejectedWritewith two differing aliases: rejectedGrepwithpatternvsquery: rejectedtools.executecall for any rejected callIt replaces the old "canonical wins" assertion.
Package builds (tsc),
biome lint,check-architecture(runtime.ts shrinks),docs:check,check:pr-base: pass.