Skip to content

fix: resolve race condition preventing concurrent permission gates fr… - #5551

Closed
utkarshtyagi-253 wants to merge 1 commit into
Agenta-AI:mainfrom
utkarshtyagi-253:main
Closed

fix: resolve race condition preventing concurrent permission gates fr…#5551
utkarshtyagi-253 wants to merge 1 commit into
Agenta-AI:mainfrom
utkarshtyagi-253:main

Conversation

@utkarshtyagi-253

Copy link
Copy Markdown

Fixes #5545

Summary

  • Include deferred approval requests in pending approval count
  • Enable batch approve/deny UI when multiple approvals are waiting
  • Preserve existing single-approval behavior

Testing

  • Reproduced with 3 simultaneous approval requests
  • Verified batch Approve all / Deny all button appears

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. Bug Report Something isn't working labels Jul 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi @utkarshtyagi-253, thanks for opening a pull request. 🙏

This PR was automatically closed because it does not yet meet our contribution requirements:

  • This PR changes functional code (SDK, API, or frontend) but includes no demo. Add a screenshot or short video of the change. Only test-only, docs-only, or chore changes may skip it.

We ask for this so every change is documented and demonstrably tested before review.

How to get it reopened
Update the PR description (and add a demo recording if your change touches functional code). The bot reopens the PR automatically once the requirements are met. No need to open a new one.

See the Contributing guide and Creating your first PR. If you think this was closed in error, leave a comment and a maintainer will take a look.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Jul 29, 2026
@github-actions github-actions Bot closed this Jul 29, 2026
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 616813d4-9b0b-4f91-9c21-a5610e3e1374

📥 Commits

Reviewing files that changed from the base of the PR and between a3e7fdf and 9a295a0.

📒 Files selected for processing (3)
  • services/runner/src/engines/sandbox_agent/acp-interactions.ts
  • services/runner/src/engines/sandbox_agent/pause.ts
  • services/runner/src/engines/sandbox_agent/run-turn.ts

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of tool-call permission requests during pauses.
    • Prevented active permission requests from being prematurely marked as incomplete or closed.
    • Improved tracking of permission requests as they move through pending, approved, denied, and paused states.

Walkthrough

The runner now reports when ACP permission requests begin, tracks their tool-call IDs in pause state, and prevents paused turns from prematurely settling those calls before permission resolution.

Changes

Sandbox permission lifecycle

Layer / File(s) Summary
ACP permission-start callbacks
services/runner/src/engines/sandbox_agent/acp-interactions.ts
Adds the optional callback to permission responder inputs and invokes it for Pi and standard ACP gates before permission handling.
In-flight pause-state integration
services/runner/src/engines/sandbox_agent/pause.ts, services/runner/src/engines/sandbox_agent/run-turn.ts
Tracks in-flight permission tool calls, clears them when paused or allowed, and excludes them from premature settlement during paused turns.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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

Labels

Bug Report Something isn't working incomplete-pr PR is missing required template sections or a demo recording size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agent-chat] Batch-approval UI (Approve all / Deny all) is unreachable: no harness ever yields 2+ simultaneously live gates

2 participants