Skip to content

fix(frontend): show waiting indicator while an approval resume streams - #5159

Merged
ardaerzin merged 4 commits into
big-agentsfrom
fe-fix/agent-chat-resume-waiting-indicator
Jul 8, 2026
Merged

fix(frontend): show waiting indicator while an approval resume streams#5159
ardaerzin merged 4 commits into
big-agentsfrom
fe-fix/agent-chat-resume-waiting-indicator

Conversation

@ardaerzin

@ardaerzin ardaerzin commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

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

AgentChatPanel now renders a persistent working indicator under the latest content for the entire busy run (status submitted 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 in AgentMessage, 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 as isVisiblePart and shared with the indicator condition, so "visible content" means the same thing in both places.

Tests / notes

  • eslint and prettier clean; tsc --noEmit in web/oss stays at the pre-existing baseline (592 errors, none in AgentChatSlice).
  • Verified live against a local run: the earlier snapshot-based version of this PR still left silent gaps after the first streamed part; this version keeps the indicator up through them.

What to QA

  • Send a message in the playground agent chat. The typing indicator shows immediately and stays visible under the newest content until the run fully settles, including while text streams in above it.
  • Trigger a tool approval and Deny it. The indicator appears right away and stays through the resume until the agent continues (and through any later between-step gaps).
  • Pause on an approval: while the approval card waits for you, the indicator is gone (the run is parked, not working).
  • Regression: press Stop mid-run. The indicator disappears and the Stopped tag shows. After the run settles normally, no indicator lingers.

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.
@vercel

vercel Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jul 8, 2026 2:57pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d27499b2-142e-4d3f-8bc2-ec76fb7292e5

📥 Commits

Reviewing files that changed from the base of the PR and between e8f466c and aa4f438.

📒 Files selected for processing (1)
  • web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Updated the chat panel to show a more compact “working” indicator under the latest turn while a response is in progress.
    • Added an “Inspect turn” action alongside the in-progress indicator for easier review of the current exchange.
  • Bug Fixes

    • Improved handling of empty assistant turns so only visible content is counted in the conversation display.
    • Refined when loading indicators appear to better match the latest message state.

Walkthrough

AgentChatPanel.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.

Changes

Agent chat status row

Layer / File(s) Summary
Visible-part predicates
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
Adds isVisiblePart and rewrites isEmptyAssistantTurn to use the shared predicate.
Working indicator component
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
Introduces WorkingDots as the three-dot busy-state indicator with accessibility labels.
Last-turn working row
web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx
Updates showWorking and replaces the prior waiting Bubble with a last-turn meta row that can render WorkingDots and an Inspect turn control.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main frontend change: showing a waiting indicator during approval-resume streaming.
Description check ✅ Passed The description is directly related and accurately explains the indicator behavior change, refactor, and QA notes.
✨ 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 fe-fix/agent-chat-resume-waiting-indicator

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

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between aeb6135 and e4d0543.

📒 Files selected for processing (1)
  • web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx

Comment thread web/oss/src/components/AgentChatSlice/AgentChatPanel.tsx Outdated
@ardaerzin
ardaerzin marked this pull request as ready for review July 8, 2026 13:55
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. Frontend labels Jul 8, 2026
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).
@ardaerzin
ardaerzin merged commit 589cf60 into big-agents Jul 8, 2026
17 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant