Skip to content

fix(wrapper): always skip permissions for the antigravity backend - #3

Closed
Overbaker wants to merge 1 commit into
mainfrom
fix/agy-headless-permissions
Closed

Overbaker wants to merge 1 commit into
mainfrom
fix/agy-headless-permissions

Conversation

@Overbaker

Copy link
Copy Markdown
Owner

Problem

codeagent-wrapper --backend antigravity runs headless agy -p. When a task needs a tool that requires approval (e.g. read_file), agy auto-denies it:

jetski: no output produced — a tool required the "read_file" permission that headless mode cannot prompt for, so it was auto-denied.

The wrapper then exits 1 with agy completed without agent_message output. agy's auto mode doesn't help: on hosts where the terminal sandbox is unavailable (AppArmor kernel.apparmor_restrict_unprivileged_userns = 1), agy logs auto mode is unavailable … falling back to default.

The claude backend already passes --dangerously-skip-permissions unconditionally (#143). buildAntigravityArgs still gated the flag on cfg.SkipPermissions, and no caller sets that.

Change

  • buildAntigravityArgs always passes --dangerously-skip-permissions, the same as claude.
  • TestAntigravityBuildArgs_AlwaysSkipsPermissions covers new mode, resume mode and a nil config.

Verification

  • go vet ./... passes.
  • New test passes.
  • End-to-end: the patched binary with real agy read a repo file and returned the expected JSON in about 51 s. Before the patch the same kind of task failed with the read_file denial.
  • go test ./... has 4 failures: TestExecutorExecuteConcurrentWithContextBranches, TestLoggerWithSuffixReturnsErrorWhenTempDirNotWritable, and two TestRunCodexTask_* timing tests. They fail identically on the base commit e99bd5b without this change (the tests run as root, and timing is environment-dependent), so they predate this PR.

Security note

agy sub-tasks now approve tools without a prompt inside the --add-dir scope. The claude backend already runs this way.

🤖 Generated with Claude Code

Headless `agy -p` auto-denies any tool that needs approval ("a tool
required the read_file permission that headless mode cannot prompt
for"), so antigravity sub-tasks returned no output and exited 1. agy's
own auto mode is no fallback: it is disabled when the terminal sandbox
is unavailable (AppArmor restricting unprivileged user namespaces).

The claude backend already passes --dangerously-skip-permissions
unconditionally (#143); the antigravity builder still gated it on
cfg.SkipPermissions, which no caller sets. Pass it unconditionally and
cover new/resume/nil args with a unit test.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <noreply@hapi.run>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Overbaker

Copy link
Copy Markdown
Owner Author

Additional verification: re-ran the long read-heavy research prompt that previously hung >10 min with no output (headless agy, pre-fix). With this patch it completed in 4m55s, exit 0, with full JSON output. The build check failure is the R2 sync step (CLOUDFLARE_API_TOKEN secret unset in this repo); cross-compile and release steps succeeded.

@Overbaker Overbaker closed this Nov 18, 2026
@Overbaker
Overbaker deleted the fix/agy-headless-permissions branch November 18, 2026 09:29
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