fix(frontend): Make parked connection requests visible and declinable #5251
fix(frontend): Make parked connection requests visible and declinable
#5251ashrafchowdury wants to merge 5 commits into
Conversation
- 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
mmabrouk
left a comment
There was a problem hiding this comment.
Thanks @ashrafchowdury I think it makes sense and it unifies the UI for approvals. The copy can be improved though.
@ardaerzin wdyt?
389d3e7 to
c5fafd2
Compare
|
Updated the copy: Connect Gmail to let the agent continue, or continue without the connection. |
Context
When the agent asks for a connection in the playground chat (a parked
request_connectionclient 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
ConnectToolWidgetintouseConnectFlow. 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 checksmeta.settled; a secondaddToolOutputfor 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").
isPendingClientToolInteractionis 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/playgroundbuilds; all 198 package unit tests pass.@agenta/ossand@agenta/playground; tsc reports no errors in touched files (the twoElicitationWidgeterrors are pre-existing on the branch).What to QA
Previews
Before:


After: