mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6951] [Issue]: Raw <tool_call> text stays in streamed replies after the call runs #3896
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3896
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SpicyMarinara on GitHub (Oct 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6951
Originally assigned to: @SpicyMarinara on GitHub.
Summary
With streaming on, a model that writes its tool calls as text (for example a KoboldCPP or Gemma setup that answers with
<tool_call>{...}</tool_call>) gets the call run correctly, but the raw<tool_call>…</tool_call>text stays at the start of the saved reply.Found while fixing #6945. It happens the same way with the Roleplay Rolls command, so it isn't new.
Expected behavior
Once Marinara recognises and runs a text tool call, that text shouldn't stay in the reply that is shown and saved.
Actual behavior
The reply starts with the raw
<tool_call>{"name":"roll_dice",…}</tool_call>, followed by the rest of the message. It's clean with streaming off, or when the backend returns real (native) tool calls.Where it comes from
openai.provider.tsstreams the text to the client before it recognises the call. The recognition is around:1919, andtextual-tool-call-parser.tsdoes the parsing.generate.routes.ts(around:8100) has already added that text to the reply and never takes it back out.Steps to reproduce
roll_dice(either through Rolls, or through Function Calling once #6945 is in).<tool_call>text at the top of the message.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: