Repository navigation
Description
Problem
When a worker calls a gated tool (e.g. run_shell), its run parks on an approval, but the workbench thread shows nothing. The person sees "Working…" with no prompt, and no notification points them anywhere. In practice the worker looks slow or stuck, when it is actually waiting on a decision only the person can make.
Today the only place a pending approval surfaces is the bench drawer's Information → Needs you section, which you have to find on your own.
This is a regression. DESIGN.md says approvals render in-thread "where the decision happens: Allow once, Always allow (this workbench, this tool), Ask every time, Deny", and the thread used to do this.
How it regressed
- fix(web,myra): chat shows pending approvals inline; a parked approval no longer aborts Myra's run (CL-8493) #896 added inline approvals to the chat transcript (
ApprovalRowin the chat thread page). - feat(web): remove standalone chats; a workbench is the only conversation #968 deleted the standalone chat thread page; the workbench thread that replaced it never rendered pending approvals.
- fix(web): the drawer head, Information and Insights tabs match the mockup (CL-9669) #1071 replaced the drawer's Approve/Deny row with a static "Waiting" pill, so at that point there was no way in the UI to answer an approval at all.
The in-thread pieces still exist but nothing wires them up: ApproveBlockView (apps/web/src/chat/blocks/approve-block.tsx) and createChatApprovalActions (apps/web/src/approval-actions.ts).
Related gaps
- No signal. The "N waiting on you" chip only renders on routes without their own top bar (effectively
/), and it counts the account's root tenant, not the workbench the approval lives in. The drawer toggle has no badge. - Stale status. Nothing refetches the approvals list when a run parks. The inbox stream doesn't tick, despite a comment in
workbench-page.tsxassuming it does. So the drawer list and the worker's "Needs you" status stay stale until something else triggers a refetch. - Orphaned approvals. If the run behind an approval is gone (e.g. the hub restarted and the worker was redeployed), the approval stays
pendingforever and Approve returns 409 ("workflow run no longer running"), surfaced as a bare "The server answered 409."
Proposed solution
- Render this workbench's pending approvals in the thread, at the point the worker parked, using
ApproveBlockView+createChatApprovalActions: who is asking, the tool, the full call arguments, and Allow once / Always allow / Deny. - Keep the drawer's Needs you section actionable as a secondary surface.
- Badge the drawer toggle (and/or the bench pill) with the pending count for this workbench.
- Poll approvals while a turn is pending, so a parked run surfaces within seconds.
- Show an approval whose run is no longer live as expired, with a clear message instead of a 409 toast.
Done when
- A worker that parks on a gated tool shows an in-thread approval card within a few seconds, with no navigation.
- Approving from the card resumes the run and the reply lands in the thread; denying ends the call.
- The workbench shows a visible pending indicator wherever the person is looking.
- A browser e2e covers park → in-thread approve → reply, against scripted inference.
Activity