Repository navigation
Parse bare <call name="..."> blocks instead of streaming them as text - #69
Merged
Merged
Conversation
DeepSeek Web sometimes answers a tool turn with only <call name="bash"><parameter name="command">...</parameter></call>. No detector matched a bare <call> tag, so the reply skipped repair and reached the client as the final answer. - collectAgentToolCalls reads <call> blocks as DSML invokes, but only when the whole reply is such blocks, so a <call> quoted in prose never runs. Results still go through the DSML parser and the tool whitelist. - looksLikeToolCallMarkup flags <call name=...> so a partial or prose-wrapped block gets the stricter retry instead of leaking.
Literal </call>, <invoke or a JSON tool envelope inside a value no longer loses or replaces the call, and values keep their entities. looksLikeToolCallMarkup now needs <call ...> followed by <parameter, so <Call name="x" /> in an answer stays text. Native tools in <call> take the native repair path.
dekrezz
enabled auto-merge
November 4, 2026 16:26
dekrezz
approved these changes
Nov 4, 2026
Owner
|
Thanks for the contribution. The captured reply in the description made the problem easy to follow. I pushed a follow-up commit on your branch. Next time you touch the parser, please try values that contain the markup itself, like |
Merged
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.
Summary
<call>block:<call>tag (looksLikeToolCallMarkup,hasDsmlToolMarkup, the JSON parsers), so the reply skips repair and is streamed to the client as the final answer withtools=0.collectAgentToolCallsnow reads<call name="...">blocks as DSML invokes, but only when the whole reply is such blocks, so a<call>quoted in prose never runs. The result still goes throughlistDsmlToolCallsand the tool whitelist.looksLikeToolCallMarkupflags<call name=...>, so a partial or prose-wrapped block gets the strict retry instead of leaking.Logs
On 2026-11-03 one pi session got this shape three times within four minutes. One of them:
pi showed the
<call name="bash">...</call>block above as the assistant's answer.Testing
npm test: 354 pass. The one failure,with real git: check sees a new release, install fast-forwards and switches channels, local edits are kept, fails the same way on main on this machine.tests/parser_bare_call.test.js: 4 cases. The captured reply, two blocks in a row, a tool the client did not offer (dropped), and a<call>inside prose (not executed, but detected). 3 of 4 fail on main.<call>shape cannot be triggered on demand, so that path is only covered by the captured reply.