Repository navigation
Conversation
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
PR updated to follow the required template. Body now includes proper issue reference, checkboxes, and explanation of why the fix works. |
|
THANK YOU |
|
Tested against an over-complex web-based project with 103037 tokens used in Qwen 3.6 27B NVFP4 without any pause. Thanks for the fix. |
|
Works.. please opencode team.. pull this in |
|
After some testing, I'm reaching the same point as @amahteletrac. I'm proposing a proper working solution in #30633. |
|
I am not able to reproduce with |
|
A tad bit slower, but in my personal experience incredibly capable local model. |
|
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 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊 |

Issue for this PR
Closes #24316
Type of change
What does this PR do?
Qwen3 via vLLM/llama.cpp with the hermes tool call parser occasionally appends raw XML tool call closing tags (
</parameter>,</function>,</parameter,␐) as a response termination artifact after natural language text. These leak into the assistant message content and appear as naked XML in the TUI, halting progress.This adds a
stripDanglingXmlArtifacts()helper that strips trailing XML artifacts from streaming text deltas at thestep()level inopenai-chat.tsbefore content reaches the consumer. Only trailing artifacts are stripped; mid-text occurrences are preserved.I understand why this works: the artifacts always appear at the end of a streaming delta chunk, so iterating and stripping trailing matches is sufficient without risking damage to legitimate content.
How did you verify your code works?
bun testinpackages/llm— 16/16 passbun typecheck— cleanScreenshots / recordings
N/A — this is a backend streaming fix.
Checklist