Skip to content

fix(cli): add --accept-permissions flag to ag run and ag create (#3336, #3337)#3416

Merged
aegis-gh-agent[bot] merged 1 commit into
developfrom
fix/3336-3337-permission-gate
May 14, 2026
Merged

fix(cli): add --accept-permissions flag to ag run and ag create (#3336, #3337)#3416
aegis-gh-agent[bot] merged 1 commit into
developfrom
fix/3336-3337-permission-gate

Conversation

@OneStepAt4time

Copy link
Copy Markdown
Owner

Summary

Fixes #3336 and #3337 β€” sessions stall on permission-gated tasks.

Problem

ag run and ag create don't pass permissionMode to the server. When Claude tries to write files, the session hits the permission gate and stalls indefinitely. ag run times out; ag create leaves zombie sessions.

Fix

New flag: --accept-permissions / -y

  • Sets permissionMode: 'bypassPermissions' on session creation
  • Both ag run and ag create support it
  • Backward compatible: without the flag, behavior is unchanged

Usage

ag run "Create a file" --accept-permissions
ag create "Build a login page" -y

Verification

  • tsc --noEmit: clean
  • Minimal change: flag parse + spread into request body

@aegis-gh-agent aegis-gh-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

βœ… Approved β€” all 9 merge gates pass.

Review summary:

  • Correct minimal fix for #3336, #3337 β€” sessions no longer stall on permission-gated tasks
  • Flag parsing (--accept-permissions / -y) is clean, backward-compatible
  • Conditional spread into request body is correct
  • CI green (all checks pass)
  • Targets develop βœ…

Minor note (non-blocking): No unit tests for the new flag. Consider adding a test case in a follow-up PR to verify permissionMode: "bypassPermissions" is included in the request body when the flag is passed. The mechanical nature of this change makes it low-risk without tests, but coverage is always welcome.

#3337)

Tasks requiring file writes stall at the permission gate because neither
ag run nor ag create passes permissionMode to the session. Sessions sit
idle waiting for approval that never comes.

New flag: --accept-permissions / -y
- Sets permissionMode: 'bypassPermissions' on session creation
- ag run: completes autonomously instead of timing out
- ag create: no longer stalls on permission-gated operations

Fixes: #3336, #3337
@OneStepAt4time OneStepAt4time force-pushed the fix/3336-3337-permission-gate branch from ac26baf to 511a7dd Compare May 14, 2026 16:28
@aegis-gh-agent aegis-gh-agent Bot merged commit 46bd6e0 into develop May 14, 2026
17 checks passed
@aegis-gh-agent aegis-gh-agent Bot deleted the fix/3336-3337-permission-gate branch May 14, 2026 16:35
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