fix(antigravity): agy CLI threads open in Full access and Auto-accept edits#33143

merged4
main
fix/antigravity-cli-permission-modes
opened1d agobyTtheo
View on GitHubTwo-way sync enabledPR last imported 1d ago

Using the Antigravity agy CLI as the custom binary broke most threads. T3 sent the managed runtime's yolo (Full access) and auto_edit (Auto-accept edits) session modes. The CLI only knows default, accept-edits, and plan, so the session failed to open:

text
1Invalid value "yolo" for session config option "mode": expected one of default, accept-edits, plan

Full access is the default mode, so every new CLI thread failed. See #32856.

Fix

When the runtime is the CLI, T3 sends default in place of yolo and auto_edit. In default the CLI asks before it acts, and T3 already answers those requests from the live permission setting: Full access allows, Auto-accept edits allows edits, and Supervised asks. So permission changes apply on the next turn, with no bypass flag and no process restart. The managed runtime is unchanged.

This takes over #32875 by @Q3yp, and their commits are kept. That PR launched agy acp --dangerously-skip-permissions for Full access and replaced the session on every permission change. Review found that a downgrade made while a session was still opening could leave the bypass flag on. Answering permissions in T3 removes the flag, and with it the race, and cuts the change to about 13 source lines.

Proof

  • Real agy 1.5.3 against a T3 dev server. On main, a Full access thread fails with the error above. On this branch one agy acp process (same PID, no flag) handles every switch:
    • Full access: a shell command runs with no prompt.
    • Supervised: the same command asks for approval, and deny works.
    • Auto-accept edits: a file edit applies with no prompt, and a shell command asks.
    • Full access again: the shell command runs with no prompt.
  • The driver test opens CLI sessions in Full access and Auto-accept edits from a non-default mode, and asserts each one sends exactly default. It fails on main with ["yolo"].

Council review

Rounds: 4

DelegateRound 1Round 2Round 3Round 4
Claude Opus 5.58/109/109/1010/10
Muse Wonder Full8/109/109/109/10
Codex GPT-6.1 Sol7/109/109/109/10

Round 1 reviewed the bypass-flag design and led to the simpler fix above.

Created with Claude Opus 5.5 in Claude Code (T3 Code).

šŸ¤– Generated with Claude Code

Checks

1 failing Ā· 23 successful Ā· 14 skipped
Some checks failed

Failing1

64b56d6

Added 4 commits

  • test(antigravity): cover agy CLI permission modes and full-access flag40a38d1
  • refactor(antigravity): keep the agy CLI in default mode instead of a bypass flag64b56d6
  • fix(antigravity): use CLI permission modes and full-access flag8fd0a6a
  • fix(antigravity): bind each session adapter to its acquired executableb4db006
Synced from GitHub

Approvability

Verdict: Approved at 64b56d6

Macroscope's review found this PR approvable — This adapts Antigravity CLI mode requests so existing Full access and Auto-accept edits selections can open sessions. Product permission defaults and managed-harness behavior remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Thread transfer impact

āœ… Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiBāœ…
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiBāœ…
CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiBāœ…
CodexLive turn WebSocket decoded21.5 KiB21.5 KiB0 B (0.0%)24.4 KiBāœ…
CodexLive turn messages110 (0.0%)8āœ…
ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiBāœ…
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiBāœ…
ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiBāœ…
ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiBāœ…
ClaudeLive turn messages110 (0.0%)8āœ…

Baseline: b24959d Ā· PR result: 64b56d6 Ā· Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.