Skip to content

fix(chat): show copy/export/regenerate actions for user-stopped (cancelled) turns - #609

Closed
shiaho777 wants to merge 1 commit into
RongleCat:mainfrom
shiaho777:fix/chat-cancelled-turn-actions
Closed

fix(chat): show copy/export/regenerate actions for user-stopped (cancelled) turns#609
shiaho777 wants to merge 1 commit into
RongleCat:mainfrom
shiaho777:fix/chat-cancelled-turn-actions

Conversation

@shiaho777

Copy link
Copy Markdown
Contributor

Summary

When a request is manually stopped by the user (turn cancelled), the bottom action bar (copy, export MD, regenerate, copy link) was sometimes not rendered, so the user could not copy or regenerate the partial reply after stopping.

This PR renders the same bottom actions below the EndOfTurnChip for cancelled turns, matching the behavior of completed turns.

中文说明

用户手动停止请求后(turn_cancelled),底部操作栏(复制、导出 MD、重新生成、复制链接)有时不显示,导致停止后无法复制或重新生成部分回复。

本 PR 在 EndOfTurnChip 下方为被取消的 turn 渲染与正常完成 turn 一致的底部操作。

Changes

  • src/components/lobe-chat/ConversationThread.tsx: render copy / export MD / copy-link / regenerate actions for turn_cancelled markers when content or a regenerate target exists.

Verification

  • No new tests; logic mirrors the existing completed-turn branch.
  • Local typecheck passed.

…elled) turns

Previously, after the user manually stops a request, the bottom actions (copy, export MD, regenerate, etc.) were not showing for the cancelled turn.

Fixed by rendering actions below EndOfTurnChip for cancelled turns.

No new tests needed; the logic is now consistent for completed turns.

@RongleCat RongleCat left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not merge. This is the cancelled-turn hunk from #608, split into its own PR, but it still targets the wrong message and does not attach actions.

  1. wrap() only takes the node. The second argument (the IIFE that builds copy/export/regen) is discarded. On current main:

    const wrap = (node) => virtualized ?

    {node}
    : node;

    Extra JS args are ignored. After this patch, cancelled turns still render only EndOfTurnChip.

  2. Even if wrap forwarded that node, m here is the turn_cancelled / turn_end marker. m.content is turn_cancelled| (or turn_end|), not the assistant reply. Copy/export would copy the journal token. regenerableAssistantId is the last assistant id in the user turn (lastRegenerableAssistantId), never this chip id, so the regen button would not appear.

  3. After Stop, Host already sets streaming: false on the assistant and appends a separate chip. The assistant bubble then uses the existing actions= path (copy / export / regen). If that toolbar is missing, the bug is on the assistant row (e.g. still streaming, empty content, or hover-only visibility) — not on the chip.

Please close this PR. If you can reproduce a cancelled assistant bubble with no toolbar, open a new PR that fixes that bubble (and add a test around lastRegenerableAssistantId / the actions guard).

@RongleCat

Copy link
Copy Markdown
Owner

Closing as the cancelled-chip toolbar is a no-op (wrap ignores the second arg) and would copy the journal marker anyway. See review.

@RongleCat RongleCat closed this Aug 13, 2026
@shiaho777

Copy link
Copy Markdown
Contributor Author

添麻烦了,刚才用了一下自己中转的Grok 4.6,调用工具有点问题

@shiaho777
shiaho777 deleted the fix/chat-cancelled-turn-actions branch August 13, 2026 14:59
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.

2 participants