Skip to content

fix(realtime): consume ChatDeltas when C++ autoparser clears Response#9538

Merged
mudler merged 1 commit into
mudler:masterfrom
richiejp:fix/realtime-chat-deltas
Apr 24, 2026
Merged

fix(realtime): consume ChatDeltas when C++ autoparser clears Response#9538
mudler merged 1 commit into
mudler:masterfrom
richiejp:fix/realtime-chat-deltas

Conversation

@richiejp
Copy link
Copy Markdown
Collaborator

The llama.cpp C++-side chat autoparser clears Reply.Message and delivers
parsed content/reasoning/tool-calls via Reply.chat_deltas. chat.go handles
this (non-SSE path uses ToolCallsFromChatDeltas/ContentFromChatDeltas/
ReasoningFromChatDeltas), but realtime.go only read pred.Response, so any
model routed through the autoparser (Qwen2.5/3 and friends) produced a
silent reply: backend emitted N tokens, the session surface saw zero.

Mirror the non-SSE chat path in realtime's triggerResponse: when deltas
carry tool calls or content, use them directly; otherwise fall back to
the existing raw-text parsing.

Notes for Reviewers

I'm not sure if this should be handled in every call site of the predict wrapper function?

Signed commits

  • Yes, I signed my commits.

The llama.cpp C++-side chat autoparser clears Reply.Message and delivers
parsed content/reasoning/tool-calls via Reply.chat_deltas. chat.go handles
this (non-SSE path uses ToolCallsFromChatDeltas/ContentFromChatDeltas/
ReasoningFromChatDeltas), but realtime.go only read pred.Response, so any
model routed through the autoparser (Qwen2.5/3 and friends) produced a
silent reply: backend emitted N tokens, the session surface saw zero.

Mirror the non-SSE chat path in realtime's triggerResponse: when deltas
carry tool calls or content, use them directly; otherwise fall back to
the existing raw-text parsing.

Assisted-by: claude-opus-4-7-1M [Claude Code]
Signed-off-by: Richard Palethorpe <io@richiejp.com>
@mudler mudler merged commit 3db60b5 into mudler:master Apr 24, 2026
41 checks passed
@localai-bot localai-bot added the bug Something isn't working label May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants