feat(agent-chat): batch approvals — Deny all + context peek [blocked on runner collect window]#5470
Conversation
When a turn parks on 2+ approval gates the dock still shows one card at a time, so "Approve all" was a blind click over the hidden siblings. Turn the batch "Approve all" into a split button: the primary click still approves the whole batch, but the caret opens a peek that lists every pending action (friendly tool name + one-line payload preview) so approving all is informed, and offers the explicit turn-level "Deny all". Deny all is the deny counterpart to Approve all — a warm reject of every open gate via resume (no teardown), never inferred from a per-card Deny. Per-card Deny/Approve are unchanged for stepping one at a time. FE-only; a per-row read/write risk chip is a later increment once the runner supplies the hint.
📝 WalkthroughSummary by CodeRabbit
WalkthroughApprovalDock adds batch “Deny all” handling and changes multi-gate approval actions to a split dropdown with payload previews and an explicit denial option. ChangesBatch approval controls
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ApprovalDock
participant PendingApprovalGates
participant onApprovalResponse
User->>ApprovalDock: Select Deny all
ApprovalDock->>PendingApprovalGates: Collect shown pending gate IDs
ApprovalDock->>onApprovalResponse: Send approved=false for each gate
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx (1)
61-62: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove or condense these implementation comments.
The helper and JSX structure already communicate the behavior; keep any necessary rationale to one short line.
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx#L61-L62: remove or reduce to a one-line rationale.web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx#L349-L353: remove or reduce to a one-line rationale.As per coding guidelines, “Keep in-code comments to at most one short line; use longer comments only for genuinely surprising constraints such as bugs, races, or ordering requirements.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 184f21b2-e085-45eb-a6b7-baaec837be88
📒 Files selected for processing (1)
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx
Draft — dormant until the runner surfaces ≥2 approval gates at once. Stacks on
feat/sessions-storage-rework.What
When a turn parks on 2+ approval gates, the dock shows one card at a time, so "Approve all" was a blind click over hidden siblings. This turns the batch "Approve all" into a split button:
Per-card Deny/Approve unchanged. FE-only; a per-row read/write risk chip is a later increment. (Implements the Stop + context surface from the approved reject-siblings proposal, PR #5444.)
Why it's a draft / blocked
The UI only triggers when the dock sees ≥2 simultaneous pending gates. On the current base the runner parks concurrent gates together but the post-drain sweep force-defers all but the first (
DEFERRED_NOT_EXECUTED), so the dock only ever shows one card — confirmed live on Pi and Claude. So this is dead-but-correct code until a small runner change surfaces the batch (hold parked siblings instead of deferring — the collect window; composes with #5382's per-card resume, no #5391 adapter work).Discussion + the ask to Mahmoud: the reject-siblings Slack thread (approved proposal #5444).
Verification
tsc --noEmitclean in the changed file; prettier + eslint clean.Do not merge until the runner surfaces the batch.