Skip to content

💄 style: show loading state for assistant message during optimistic update#13733

Merged
arvinxx merged 1 commit into
canaryfrom
fix/assistant-loading-optimistic
Apr 11, 2026
Merged

💄 style: show loading state for assistant message during optimistic update#13733
arvinxx merged 1 commit into
canaryfrom
fix/assistant-loading-optimistic

Conversation

@arvinxx

@arvinxx arvinxx commented Apr 11, 2026

Copy link
Copy Markdown
Member

💻 Change Type

  • 🐛 fix

🔀 Description of Change

During sendMessage optimistic update, the assistant message is created with content: LOADING_FLAT ("...") but the loading indicator (<ContentLoading>) was not displayed.

Root cause: isMessageGenerating only checks AI_RUNTIME_OPERATION_TYPES (execAgentRuntime / execServerAgentRuntime), which doesn't include the sendMessage operation type. During the gap between sendMessage and execAgentRuntime, generating is false, so DisplayContent returns null for the "..." content.

Fix: Also check isMessageCreating (which covers the sendMessage operation) alongside isMessageGenerating so the loading dots appear immediately when the message is sent.

🧪 How to Test

  • No tests needed
  1. Send a message in any conversation
  2. Observe the assistant message area immediately after sending
  3. The "..." loading indicator should now appear during the brief sendMessage phase before streaming begins

🤖 Generated with Claude Code

During optimistic update, the assistant message content is "..." but the
loading indicator was not shown because isGenerating only checks
AI_RUNTIME_OPERATION_TYPES (execAgentRuntime), not sendMessage. Include
isCreating state so the loading dots appear immediately when message is sent.

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

vercel Bot commented Apr 11, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 11, 2026 11:31am

Request Review

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Apr 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.56%. Comparing base (39bca4b) to head (48cf53b).
⚠️ Report is 2 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #13733      +/-   ##
==========================================
- Coverage   66.56%   66.56%   -0.01%     
==========================================
  Files        2024     2024              
  Lines      171319   171319              
  Branches    16639    16636       -3     
==========================================
- Hits       114042   114040       -2     
- Misses      57153    57155       +2     
  Partials      124      124              
Flag Coverage Δ
app 58.62% <ø> (-0.01%) ⬇️
database 92.56% <ø> (ø)
packages/agent-runtime 79.72% <ø> (ø)
packages/context-engine 83.33% <ø> (ø)
packages/conversation-flow 92.36% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.86% <ø> (ø)
packages/model-runtime 84.30% <ø> (ø)
packages/prompts 69.24% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 90.14% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

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

Components Coverage Δ
Store 65.76% <ø> (ø)
Services 52.19% <ø> (ø)
Server 66.27% <ø> (-0.01%) ⬇️
Libs 52.83% <ø> (ø)
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.

@arvinxx arvinxx changed the title 🐛 fix: show loading state for assistant message during optimistic update 💄 style: show loading state for assistant message during optimistic update Apr 11, 2026
@arvinxx arvinxx merged commit c255bfe into canary Apr 11, 2026
30 of 31 checks passed
@arvinxx arvinxx deleted the fix/assistant-loading-optimistic branch April 11, 2026 12:37
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