Skip to content

🪲 BUG: Fix messages blending together across tool calls - #18

Merged
FernandoCelmer merged 1 commit into
masterfrom
fix-turnend
Aug 15, 2026
Merged

🪲 BUG: Fix messages blending together across tool calls#18
FernandoCelmer merged 1 commit into
masterfrom
fix-turnend

Conversation

@FernandoCelmer

@FernandoCelmer FernandoCelmer commented Aug 15, 2026

Copy link
Copy Markdown
Member

pycodeloop's serve.py has emitted a chat/turnEnd notification after every provider turn since dotflow-io/pycodeloop@fa0689f — but this extension never listened for it. FORWARDED_NOTIFICATIONS (chat.types.ts) didn't include it, so the webview never got a signal to close the current assistant bubble at a tool-call boundary.

Symptom: narration text before a tool call (e.g. "Sure, let me check that file:") and the model's final answer after the tool result get concatenated into the same bubble instead of appearing as separate turns — the tool-call card renders as a separate element sandwiched between them, but the text silently merges. Over a multi-tool-call run this reads as the assistant "losing track" of what it's saying.

Root cause: appendAssistantDelta reuses the existing assistantTurn object if one is still open. Nothing ever closed it between turns — only case "done" did, once, at the very end of the whole run.

Fix: forward chat/turnEnd, handle it by closing the current bubble (finishAssistantTurn()) so the next textDelta starts a fresh one. Added a turnEndSeen flag so case "done"'s fallback-text render (needed for CLI versions older than turnEnd's introduction) doesn't duplicate the last bubble when turnEnd already closed it.

Test plan

  • npm test (43 passed) / npx tsc --noEmit / npm run lint clean
  • Traced through single-turn, multi-tool-call, and no-turnEnd (old CLI) scenarios by hand — see PR description above

@FernandoCelmer
FernandoCelmer merged commit cbe6932 into master Aug 15, 2026
2 checks passed
@FernandoCelmer
FernandoCelmer deleted the fix-turnend branch August 15, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant