fix(cli): add --accept-permissions flag to ag run and ag create (#3336, #3337)#3416
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
β 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
ac26baf to
511a7dd
Compare
This was referenced May 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3336 and #3337 β sessions stall on permission-gated tasks.
Problem
ag runandag createdon't passpermissionModeto the server. When Claude tries to write files, the session hits the permission gate and stalls indefinitely.ag runtimes out;ag createleaves zombie sessions.Fix
New flag:
--accept-permissions/-ypermissionMode: 'bypassPermissions'on session creationag runandag createsupport itUsage
Verification