Repository navigation
Conversation
Only the two transport shapes now become tool calls: XML function_calls markup and JSON objects typed tool_call. Code fences and inline code hold examples and never run, and a JSON call must name a tool in the request. String parameters keep their exact bytes. Values are typed by the request's tool schemas, close tags inside a value no longer truncate it, CDATA is taken verbatim, entities decode once across all of Unicode, and valid JSON escapes are no longer rewritten. Batches keep every call. Distinct JSON calls are no longer dropped, a truncated XML batch fails as o1_code_incomplete_tool_call instead of running its prefix, repeated ids get fresh ones, and a malformed fallback candidate no longer hides a later valid one. JSON history keeps call ids. The XML reminder gains two rules about fences and CDATA, so the pinned Opus envelope hash is updated.
Contributor
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
3 of 6 tasks
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue (optional)
None. Follows the bridge review findings H1–H4.
Companion PR: https://github.com/trmosala/CM-WPP-Bits/pull/1 ports the same fix to the extracted bridge package. That keeps the fix when the CookieMonster split removes
packages/desktop/src/main/wpp-bridge/from this repo.Type of change
What does this PR do?
Hardens
toolCallNormalizer.mjs, which turns WPP model text into tool calls:namefield, no longer runs as a tool call. Only XMLfunction_callsmarkup and JSON typedtool_callcount. A JSON call must also name a tool from the request.o1_code_incomplete_tool_callinstead of running only its first part.Behaviour change: a reply that consists only of a fenced call no longer runs. The WPP agent prompt already forbids fencing calls. If such a reply is also missing the completion marker, the bridge still sends one continuation turn. Proxy logs omit payloads by default, so I couldn't measure how often agents fence calls.
The XML reminder gains two rules, one about fences and one about CDATA, so the pinned Opus envelope hash changes. I checked that those two lines are the only difference. The WPP agent prompt doesn't need reinstalling.
This PR doesn't change authentication, browser grants, permissions, logging, dependencies or release workflows.
How did you verify your code works?
bun test src/main/wpp-bridge/frompackages/desktop: 518 pass, 0 fail, including 18 new normalizer tests.bun typecheckfrompackages/desktop: pass.oxlint packages/desktop/src/main/wpp-bridge/proxy: 0 errors. The 2 warnings are in code this PR doesn't touch.Screenshots / recordings
Not a UI change.
Checklist