Repository navigation
feat(opencode): add XML tool-call fallback via OPENCODE_XML_TOOL_FALLBACK - #52727
Closed
vector0902 wants to merge 1 commit into
Closed
vector0902 wants to merge 1 commit into
vector0902 wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Member
|
This branch has been upgraded to V2. We're no longer taking PRs for V1. If you think this is still relevant, please port it over and open it for V2. — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |
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.
Issue for this PR
Related to #43385 / #50206 (models emitting XML tool calls as plain text).
Type of change
What does this PR do?
Opt-in fallback for models that emit XML-style tool calls as plain text into the chat (e.g.
DeepSeek V4 flash outputting
<invoke name="bash"><parameter name="command">…instead ofstructured
tool_calls), gated by envOPENCODE_XML_TOOL_FALLBACK=1(default off).packages/opencode/src/session/tool-xml.tsparses<invoke>/<parameter>blocks.processor.ts(text-end) synthesizes them into real tool-call parts via existingensureToolCall/updateToolCallpath, so the tool executes and XML no longer renders as rawtext.
packages/core/src/flag/flag.ts.How did you verify your code works?
bun test: 8 parser tests pass (multi-block, invalid/unclosed, whitespace, angle brackets,cleanText removal).
packages/opencode,packages/core) passes.<invoke name="bash">…produced a real bash tool part and executed.Screenshots / recordings
N/A
Checklist