Skip to content

fix(frontend): Make parked connection requests visible and declinable #5251

Open
ashrafchowdury wants to merge 5 commits into
big-agentsfrom
feat-agent-updated-interaction-dock
Open

fix(frontend): Make parked connection requests visible and declinable #5251
ashrafchowdury wants to merge 5 commits into
big-agentsfrom
feat-agent-updated-interaction-dock

Conversation

@ashrafchowdury

Copy link
Copy Markdown
Contributor

Context

When the agent asks for a connection in the playground chat (a parked request_connection client tool), the runner legitimately ends the stream. Every "in progress" signal in the chat was derived from stream status, so the UI looked idle: no working dots, a plain send button. Meanwhile the queue gate (isHitlPending) held every new message, so sends piled up as "1 queued" with no visible reason. Users read this as the agent being stuck and kept resending. There was also no way to refuse the request: the inline chip only offered Connect, and the timeout only arms after the popup opens, so an ignored request froze the conversation forever (a reload restored the same frozen state).

Changes

The paused run is now a first-class "waiting for you" state, following the existing ApprovalDock contract (the dock owns the actions, the inline row is a marker).

InteractionDock (new). A persistent card between the transcript and the composer: "The agent is waiting for you", with Connect and "Not now" buttons. It cannot scroll out of reach. "Not now" settles the parked call with {connected: false, reason: "declined"} (distinct from "cancelled", which means an abandoned popup), so the run resumes, the agent can respond gracefully, and queued messages release.

Shared OAuth flow. The popup flow (create connection, origin-validated callback, closed-popup poll, timeout backstop) moved from ConnectToolWidget into useConnectFlow. The dock runs the live parked call; the inline chip keeps the post-settle states (result chip, Retry). Both instances can be mounted for the same call, so every live-settle path now also checks meta.settled; a second addToolOutput for the same call is impossible.

The composer tells the truth while paused:

Before: placeholder "Ask the agent...", plain send button, pill "1 queued".
After: placeholder says the agent is waiting and new messages will be queued, the last turn shows a static "Waiting for your input" chip in the working-dots slot, and the pill reads "1 queued · waiting on you" (popover: "Held until you answer the agent").

isPendingClientToolInteraction is now exported from @agenta/playground, so the dock's visibility and the queue's hold derive from the same predicate and cannot disagree.

Tests / notes

  • @agenta/playground builds; all 198 package unit tests pass.
  • eslint clean on @agenta/oss and @agenta/playground; tsc reports no errors in touched files (the two ElicitationWidget errors are pre-existing on the branch).
  • The OAuth popup was not exercised end to end against a local stack; worth one manual pass.
  • Elicitation forms stay inline (they carry their own Decline/Dismiss); they get the composer waiting state but no dock card.

What to QA

  • Ask an agent to use a tool whose connection is missing (e.g. Telegram). The dock card appears above the composer, the last turn shows "Waiting for your input", and the placeholder changes.
  • Type a message while the request is pending. It queues; the pill says "1 queued · waiting on you" and the popover explains the hold.
  • Click "Not now". The run resumes, the agent acknowledges and continues, then the queued message sends.
  • Click Connect and finish the OAuth popup. The inline chip flips to "connected" and the run resumes. Closing the popup midway resumes the run as cancelled.
  • Reload the page while a request is pending. The dock reappears and both buttons still work (before this change, a reload restored a frozen chat).
  • Regression: tool approvals still pause into the ApprovalDock unchanged, and a normal streaming turn still shows the dots and the spinning stop button.

Previews

Before:
image.png
After:
image.png

- Added InteractionDock component to manage parked client-tool interactions, mirroring ApprovalDock's functionality.
- Introduced WaitingForInput component to indicate when the agent is waiting for user input.
- Updated AgentConversation to integrate InteractionDock and display waiting states appropriately.
- Enhanced QueuedMessages to reflect held messages when the interaction is pending.
- Refactored ConnectToolWidget to utilize useConnectFlow for managing connection states and actions.
- Added useConnectFlow hook to centralize connection logic for both InteractionDock and inline components.
- Updated state management to include isPendingClientToolInteraction for better handling of client-tool interactions.
@vercel

vercel Bot commented Jul 12, 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 13, 2026 2:50pm

Request Review

@dosubot dosubot Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. Frontend labels Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70eb9c28-5026-482f-a619-f1ed052e5951

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-agent-updated-interaction-dock

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.

@ashrafchowdury ashrafchowdury changed the base branch from main to big-agents July 12, 2026 14:55
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Jul 12, 2026

@mmabrouk mmabrouk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @ashrafchowdury I think it makes sense and it unifies the UI for approvals. The copy can be improved though.

@ardaerzin wdyt?

@ashrafchowdury

Copy link
Copy Markdown
Contributor Author

Updated the copy:

Connect Gmail to let the agent continue, or continue without the connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants