Skip to content

🚸(front) cover the gap between the summary and the first answer token - #658

Merged
providenz merged 1 commit into
mainfrom
providenz/enahnce-compaction-frontend
Aug 6, 2026
Merged

🚸(front) cover the gap between the summary and the first answer token#658
providenz merged 1 commit into
mainfrom
providenz/enahnce-compaction-frontend

Conversation

@providenz

@providenz providenz commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Purpose

An interrupted chat turn could end with a silent blank bubble instead of an error, and the wait between the end of a conversation summarization and the first token of the answer showed no feedback at all.

Proposal

  • Stop the chat SDK from automatically resubmitting a turn that ended on a resolved tool call, so an interruption surfaces as an error with a retry rather than an empty response
  • Keep a loading indicator on screen between the end of the summarization progress bar and the first token of the answer
  • Make the message renderer react to tool call state transitions, which previously left both indicators frozen
  • Add frontend tests covering the non-resubmission and both indicator handovers

Summary by CodeRabbit

  • Bug Fixes

    • Prevented duplicate requests after summarization and tool execution.
    • Preserved interrupted-turn errors so conversations can be retried.
    • Added a “Thinking...” indicator while responses continue loading after summarization.
  • User Experience

    • The thinking indicator now appears and disappears smoothly as answer content begins streaming.
    • Improved transitions between tool execution, summarization, and response generation.
  • Tests

    • Added coverage for multi-step continuation, loading states, and summarization progress behavior.

#659

Signed-off-by: Laurent Paoletti <lp@providenz.fr>
@providenz providenz added the noChangeLog This does not require a changelog line label Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c2bf28e3-8a9d-44ec-9e6f-fc497f422c96

📥 Commits

Reviewing files that changed from the base of the PR and between 362e543 and 0d83997.

📒 Files selected for processing (6)
  • src/frontend/apps/conversations/src/features/chat/api/__tests__/useChat.test.tsx
  • src/frontend/apps/conversations/src/features/chat/api/useChat.tsx
  • src/frontend/apps/conversations/src/features/chat/components/MessageItem.tsx
  • src/frontend/apps/conversations/src/features/chat/components/SummarizationProgress.tsx
  • src/frontend/apps/conversations/src/features/chat/components/__tests__/MessageItem.test.tsx
  • src/frontend/apps/conversations/src/features/chat/components/__tests__/SummarizationProgress.test.tsx

Walkthrough

useChat now sends one client-side AI SDK step. Chat rendering tracks summarization dismissal, displays a temporary “Thinking...” state, and updates when tool invocation states change. Tests cover interrupted streams and summarization transitions.

Changes

Chat streaming behavior

Layer / File(s) Summary
Single-step chat request behavior
src/frontend/apps/conversations/src/features/chat/api/useChat.tsx, src/frontend/apps/conversations/src/features/chat/api/__tests__/useChat.test.tsx
useChat uses maxSteps: 1. The integration test verifies that an interrupted tool-call stream produces one chat POST without an error.
Post-summarization streaming state
src/frontend/apps/conversations/src/features/chat/components/MessageItem.tsx, src/frontend/apps/conversations/src/features/chat/components/SummarizationProgress.tsx
SummarizationProgress invokes onHidden after its delay. MessageItem shows “Thinking...” until answer content or another tool invocation appears. Memoization now tracks tool invocation states.
Streaming behavior validation
src/frontend/apps/conversations/src/features/chat/components/__tests__/*
Tests cover provider setup, timer cleanup, delayed hiding, the “Thinking...” state, and its removal when answer content streams.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant useChat
  participant AISDK
  participant ChatAPI
  User->>useChat: append user message
  useChat->>AISDK: configure maxSteps=1
  AISDK->>ChatAPI: submit chat request
  ChatAPI-->>AISDK: return interrupted tool-call stream
  AISDK-->>useChat: preserve response state
Loading
sequenceDiagram
  participant MessageItem
  participant SummarizationProgress
  participant StreamedAnswer
  MessageItem->>SummarizationProgress: render completed progress
  SummarizationProgress-->>MessageItem: invoke onHidden after 400 ms
  MessageItem->>MessageItem: show Thinking...
  StreamedAnswer-->>MessageItem: provide answer content
  MessageItem->>MessageItem: hide Thinking...
Loading

Possibly related PRs

Suggested reviewers: maxenceh, elvoisin

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the loading indicator change between summarization and the first answer token.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch providenz/enahnce-compaction-frontend

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

sonarqubecloud Bot commented Aug 6, 2026

Copy link
Copy Markdown

@providenz
providenz merged commit 0d83997 into main Aug 6, 2026
30 of 31 checks passed
@providenz
providenz deleted the providenz/enahnce-compaction-frontend branch August 6, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

noChangeLog This does not require a changelog line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant