Skip to content

feat(agent-chat): batch approvals — Deny all + context peek [blocked on runner collect window]#5470

Draft
ardaerzin wants to merge 1 commit into
feat/sessions-storage-reworkfrom
fe-feat/approval-batch-actions
Draft

feat(agent-chat): batch approvals — Deny all + context peek [blocked on runner collect window]#5470
ardaerzin wants to merge 1 commit into
feat/sessions-storage-reworkfrom
fe-feat/approval-batch-actions

Conversation

@ardaerzin

Copy link
Copy Markdown
Contributor

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:

  • primary click still approves the whole batch,
  • the caret opens a peek listing every pending action (friendly tool name + one-line payload preview) so approving all is informed,
  • and offers an explicit turn-level Deny all — a warm reject of every open gate via resume (never inferred from a per-card Deny).

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

  • oss tsc --noEmit clean in the changed file; prettier + eslint clean.

Do not merge until the runner surfaces the batch.

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

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a payload preview for batch approval requests.
    • Added a “Deny all” option for multi-step approval batches.
    • Added a dropdown menu for reviewing pending gates before approving or denying them.
  • Bug Fixes

    • Improved approval handling by preventing further actions while batch decisions are being processed.

Walkthrough

ApprovalDock adds batch “Deny all” handling and changes multi-gate approval actions to a split dropdown with payload previews and an explicit denial option.

Changes

Batch approval controls

Layer / File(s) Summary
Batch denial resolution
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx
Tracks "deny-all" resolution, freezes all shown pending gates, and sends approved: false responses for each gate.
Split approval and preview UI
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx
Replaces the multi-gate approval button with a split dropdown that previews collapsed, truncated inputs and exposes “Deny all”.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: batch approval controls adding Deny all and a context peek.
Description check ✅ Passed The description clearly covers the same batch approval split-button, peek preview, and Deny all behavior.
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.
✨ 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-feat/approval-batch-actions

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.

@vercel

vercel Bot commented Jul 23, 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 23, 2026 4:43pm

Request Review

@ardaerzin

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 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.

🧹 Nitpick comments (1)
web/oss/src/components/AgentChatSlice/components/ApprovalDock.tsx (1)

61-62: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove 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

📥 Commits

Reviewing files that changed from the base of the PR and between 17dd3a1 and 35f7b28.

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

ardaerzin added a commit that referenced this pull request Jul 24, 2026
Stop is verified warm (§5 acceptance passes). Steer's 'message as model feedback' (§3) is NOT reachable pure-FE — both harnesses continue the original turn on reject and the ACP reply carries no text; the redirect needs runner path A or ACP-chain patch C. UI shipped flag-gated (#5477). Batch surfacing is a small runner change (#5470), not blocked by #5391.
ardaerzin added a commit that referenced this pull request Jul 24, 2026
…/Stop/steer) (#5444)

* docs(agent-workflows): reject-siblings approval policy proposal (Deny/Stop/steer)

* docs(agent-workflows): add task-5 implementation findings

Stop is verified warm (§5 acceptance passes). Steer's 'message as model feedback' (§3) is NOT reachable pure-FE — both harnesses continue the original turn on reject and the ACP reply carries no text; the redirect needs runner path A or ACP-chain patch C. UI shipped flag-gated (#5477). Batch surfacing is a small runner change (#5470), not blocked by #5391.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant