Skip to content

πŸ’„ style: show interrupted hint when AI generation is stopped#13397

Merged
arvinxx merged 6 commits intocanaryfrom
feat/interrupted-banner
Mar 30, 2026
Merged

πŸ’„ style: show interrupted hint when AI generation is stopped#13397
arvinxx merged 6 commits intocanaryfrom
feat/interrupted-banner

Conversation

@arvinxx
Copy link
Copy Markdown
Member

@arvinxx arvinxx commented Mar 30, 2026

Summary

  • Show "Interrupted Β· What should I do instead?" hint below message when user stops AI generation, replacing the infinite dotting animation
  • Add isInterrupted state to MessageOperationState, computed from cancelled AI runtime operations
  • Fix completeOperation to preserve cancelled status instead of overwriting it with completed
  • Support both AssistantMessage and AssistantGroup (with tool use) message types
  • Add edit button (pencil icon) to queued messages tray β€” clicking removes the message from queue and restores its content to the input editor

Fixes LOBE-4462
Fixes LOBE-5726

Test plan

  • Send a message to an agent, stop generation mid-stream β†’ verify "Interrupted" hint appears below message
  • Send a message that triggers tool use (e.g. search), stop during tool execution β†’ verify hint appears
  • Verify dotting animation stops after interruption
  • Verify hint disappears when starting a new generation
  • Check both zh-CN and en-US locales
  • While AI is generating, send 2+ messages to queue them β†’ verify pencil (edit) and trash icons appear
  • Click pencil icon on a queued message β†’ verify message is removed from queue and content appears in input editor

πŸ€– Generated with Claude Code

Display "Interrupted Β· What should I do instead?" text below the message
when user stops AI generation, replacing the infinite dotting animation.

Fixes LOBE-4462
Fixes LOBE-5726

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Mar 30, 2026 8:19am

Request Review

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@lobehubbot
Copy link
Copy Markdown
Member

@ONLY-yours - This involves conversation UI and chat operation state changes (interrupted hint for streaming). Please take a look.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
βœ… Project coverage is 66.88%. Comparing base (91b2653) to head (5318b82).
⚠️ Report is 5 commits behind head on canary.

Additional details and impacted files
@@           Coverage Diff           @@
##           canary   #13397   +/-   ##
=======================================
  Coverage   66.88%   66.88%           
=======================================
  Files        1905     1905           
  Lines      154323   154338   +15     
  Branches    18472    18475    +3     
=======================================
+ Hits       103222   103236   +14     
- Misses      50981    50982    +1     
  Partials      120      120           
Flag Coverage Ξ”
app 58.48% <94.11%> (+<0.01%) ⬆️
database 96.66% <ΓΈ> (ΓΈ)
packages/agent-runtime 89.26% <ΓΈ> (ΓΈ)
packages/context-engine 86.51% <ΓΈ> (ΓΈ)
packages/conversation-flow 92.36% <ΓΈ> (ΓΈ)
packages/file-loaders 87.02% <ΓΈ> (ΓΈ)
packages/memory-user-memory 66.68% <ΓΈ> (ΓΈ)
packages/model-bank 99.85% <ΓΈ> (ΓΈ)
packages/model-runtime 84.44% <ΓΈ> (ΓΈ)
packages/prompts 67.76% <ΓΈ> (ΓΈ)
packages/python-interpreter 92.90% <ΓΈ> (ΓΈ)
packages/ssrf-safe-fetch 0.00% <ΓΈ> (ΓΈ)
packages/utils 90.41% <ΓΈ> (ΓΈ)
packages/web-crawler 88.82% <ΓΈ> (ΓΈ)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Ξ”
Store 67.03% <100.00%> (+<0.01%) ⬆️
Services 49.30% <ΓΈ> (ΓΈ)
Server 67.27% <ΓΈ> (ΓΈ)
Libs 51.03% <ΓΈ> (ΓΈ)
Utils 91.01% <ΓΈ> (ΓΈ)
πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

πŸ’‘ Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c5efc7cb46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with πŸ‘.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Allow users to edit queued messages by clicking the pencil icon,
which removes the message from the queue and restores its content
to the input editor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
arvinxx and others added 4 commits March 30, 2026 15:44
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously isInterrupted used .some() to check if any cancelled AI
runtime operation existed for a message. In stop-then-retry flows,
the old cancelled op persisted alongside the new completed one,
causing the interrupted hint to reappear after the retry finished.

Now only the latest AI runtime operation is checked, so completed
retries correctly clear the interrupted state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
For assistant groups, continuation runs attach cancelled operations to
lastBlockId (contentId) rather than the group root. Check isInterrupted
on both the group root and the active block so the interrupted hint
is shown correctly for stopped group continuations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The test for resolving aborted tools after cancellation now correctly
expects 'cancelled' status, since completeOperation preserves the
user's intentional cancellation rather than overwriting it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@arvinxx arvinxx changed the title ✨ feat: show interrupted hint when AI generation is stopped πŸ’„ style: show interrupted hint when AI generation is stopped Mar 30, 2026
@arvinxx arvinxx merged commit 143a15f into canary Mar 30, 2026
34 checks passed
@arvinxx arvinxx deleted the feat/interrupted-banner branch March 30, 2026 10:46
@lobehubbot
Copy link
Copy Markdown
Member

❀️ Great PR @arvinxx ❀️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.

cy948 pushed a commit to cy948/lobe-chat that referenced this pull request Mar 31, 2026
…#13397)

* ✨ feat: show interrupted hint when AI generation is stopped

Display "Interrupted Β· What should I do instead?" text below the message
when user stops AI generation, replacing the infinite dotting animation.

Fixes LOBE-4462
Fixes LOBE-5726

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* ✨ feat: add edit button to queued messages tray

Allow users to edit queued messages by clicking the pencil icon,
which removes the message from the queue and restores its content
to the input editor.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* πŸ“ chore: move record-electron-demo.sh to electron-testing skill

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* πŸ› fix: derive isInterrupted from latest runtime operation only

Previously isInterrupted used .some() to check if any cancelled AI
runtime operation existed for a message. In stop-then-retry flows,
the old cancelled op persisted alongside the new completed one,
causing the interrupted hint to reappear after the retry finished.

Now only the latest AI runtime operation is checked, so completed
retries correctly clear the interrupted state.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* πŸ› fix: read group interruption from active block ID

For assistant groups, continuation runs attach cancelled operations to
lastBlockId (contentId) rather than the group root. Check isInterrupted
on both the group root and the active block so the interrupted hint
is shown correctly for stopped group continuations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* βœ… test: update test to expect cancelled status after user stop

The test for resolving aborted tools after cancellation now correctly
expects 'cancelled' status, since completeOperation preserves the
user's intentional cancellation rather than overwriting it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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