Skip to content

fix(dashboard):chat answer collapse after tool - #1995

Open
jerryldh wants to merge 1 commit into
TencentCloud:developfrom
jerryldh:fix/chat-answer-collapse-after-tool
Open

jerryldh wants to merge 1 commit into
TencentCloud:developfrom
jerryldh:fix/chat-answer-collapse-after-tool

Conversation

@jerryldh

@jerryldh jerryldh commented Oct 13, 2026 •

Copy link
Copy Markdown

Summary

Target branch

  • Base is develop (feature / fix — default)
  • Base is main (release/* or hotfix/* only)

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore
  • Release / hotfix

Test plan

  • make all passes locally
  • Added/updated tests

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

@jerryldh jerryldh changed the title Fix/chat answer collapse after tool fix(dashboard):chat answer collapse after tool Oct 13, 2026
@jerryldh
jerryldh changed the base branch from main to develop October 13, 2026 12:24
@jerryldh
jerryldh force-pushed the fix/chat-answer-collapse-after-tool branch from a392b0a to 2cdad49 Compare October 13, 2026 12:31
…xt bubbles

A settled 1:1 turn like "answer → edit_file → closing note" was collapsing to
only the last text bubble, so the real answer vanished from the transcript as
soon as streaming ended (it reappeared only after a history refresh pulled in
a merged row). Root cause: `splitAssistantTurn` dropped every pre-tool text
fragment whenever *any* completed tool sat between text bubbles.

That heuristic is only correct for delegation hand-offs (`ask_agent`), where
the pre-tool narration is genuinely superseded by the conclusion — which is
exactly what the existing "keeps a 1:1 ReAct conclusion as the answer" test
covers. Ordinary tools (read / edit / shell / …) continue the same answer, so
their surrounding text must stay joined.

- Narrow the collapse condition to `hasCompletedDelegationBetweenTexts`
  (completed `ask_agent` only), replacing the all-tools check.
- Add regressions: an `edit_file` round and a multi-tool round must both keep
  the full answer, not just the closing sentence.

Verified: `vitest run src/pages/Chat/utils/messageGrouping.test.ts` — 25 passed.
@jerryldh
jerryldh force-pushed the fix/chat-answer-collapse-after-tool branch from 2cdad49 to e4ea32f Compare October 13, 2026 12:32

This branch has not been deployed

No deployments
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