fix(frontend): show waiting indicator while an approval resume streams - #5159
Conversation
A settle-driven resume (approval approve/deny, client-tool result) re-sends without a new user turn, so the transcript showed no sign of the in-flight run until its first new part streamed in. Snapshot the last turn while idle and render the waiting bubble under it while the resumed run has not yet produced a new visible part.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Disabled knowledge base sources:
📝 WalkthroughSummary by CodeRabbit
WalkthroughAgentChatPanel.tsx now uses a shared visible-part predicate for assistant turn emptiness, adds a reusable three-dot working indicator, and changes the last-turn busy UI to a meta row that can show working status and an inspect control. ChangesAgent chat status row
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant AgentChatPanel
participant AgentMessage
participant User
AgentChatPanel->>AgentChatPanel: Compute isEmptyAssistantTurn from visible parts
AgentChatPanel->>AgentChatPanel: Set showWorking for last busy turn
AgentChatPanel->>AgentMessage: Render last turn content
AgentChatPanel->>User: Show WorkingDots in meta row when busy
AgentChatPanel->>User: Show Inspect turn control when available
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 41d1dab5-b229-4136-809d-b9d0f5614ebc
📒 Files selected for processing (1)
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
The snapshot approach only bridged the gap until the FIRST new part of a resumed run; later silent stretches (between steps, server tool waits, post-tool thinking) still read as frozen. Replace it with a persistent working indicator under the latest content for the entire busy run, skipped only while an empty streaming turn shows its own loading bubble.
The busy indicator was a bubble-sized row stacked above Inspect turn, giving every streaming turn two floors of trailing chrome. Replace it with a compact three-dot pulse that shares one meta line with the Inspect-turn affordance; the dots drop on settle, leaving just the affordance (or nothing in chat mode).
Context
In the playground agent chat, long stretches of a run produce no visible output: the cold-replay after a HITL approval settle (approve or deny adds no new user message), the gaps between steps, server-side tool waits, and post-tool thinking. During those stretches the transcript does not move at all; the only sign of life is the composer's stop spinner, so the chat reads as frozen or stale.
The two existing loading affordances both miss these cases. The waiting bubble only rendered while
status === "submitted"with a non-assistant last message, and the in-message loading state only shows while a streaming turn has no content yet. As soon as a turn has any content, every later silent gap in the same run showed nothing.Changes
AgentChatPanelnow renders a persistent working indicator under the latest content for the entire busy run (statussubmitted or streaming), the way coding-agent UIs do. It drops the moment the run settles (done, error, stop, or an approval pause, which ends the stream). An empty streaming assistant turn already renders its own loading bubble inAgentMessage, so the indicator is skipped there: there is always exactly one indicator while the run is busy, and none once it settles.Before: the indicator appeared only between sending a message and the start of the reply.
After: the indicator is visible from send to settle, including approval-resume cold-replays, between-step gaps, and server tool waits.
isEmptyAssistantTurn's part predicate was extracted asisVisiblePartand shared with the indicator condition, so "visible content" means the same thing in both places.Tests / notes
eslintandprettierclean;tsc --noEmitinweb/ossstays at the pre-existing baseline (592 errors, none in AgentChatSlice).What to QA