Runtime mode changed mid-turn doesn't apply to the running turn, so Antigravity keeps asking for approval under Full access #39866
What happened#
An Antigravity thread kept asking for approval on every shell command, including SQL queries it ran against PostHog. The thread was switched to Full access partway through, and the composer showed Full access, but the approval cards kept coming. The user clicked "Allow once" 9 times in about 11 minutes.
Diagnosis#
Two things combine.
The thread started in Auto (
defaultRuntimeMode: auto). For Antigravity, Auto sends every non-denied permission request to the user on purpose.antigravityPermissionDispositionturnsallowintoaskwhenruntimeMode === "auto"(apps/server/src/provider/acp/AntigravityAcpSupport.ts:184-191). That part works as designed.Switching to Full access mid-turn never reaches the running turn. Antigravity declares
supportsRuntimeModeSwitchInSession: true(AntigravityAdapterV2.ts:65), sothread.runtime-mode.setkeeps the live session (Orchestrator.ts:4721-4726). But the ACP adapter sets the runtime policy only at turn start (latestRuntimePolicy = turnInput.runtimePolicy,packages/provider-acp/src/server/adapter.ts:9157). The permission handler then decides from the turn's own copy,context?.input.runtimePolicy ?? latestRuntimePolicy(adapter.ts:7291). Nothing updates either of these when the mode changes during a turn, or when a steer message carries a mode change.
As a result, the running turn keeps answering permission requests under Auto until it ends, while the UI shows Full access. A comment in AntigravityAcpSupport.ts says permission changes "apply on the next turn", so the deferral may be intended. But nothing in the UI tells the user, and a long agent turn can run for many minutes after the switch.
In this thread, the switch came with a steer message (message.dispatch and thread.runtime-mode.set both at 19:54:09) into a turn that had started at 19:52:45. That turn came from a server-restart continuation. All 7 approval cards after the switch belonged to that same turn.
Possible directions: re-read the thread's live runtime policy when answering a permission request, as the followsAgentWorkState path already does with latestRuntimePolicy. Or update the active turn's policy on thread.runtime-mode.set. Or, at minimum, show in the UI that the new mode takes effect on the next turn.
main at 0702c6f still has the same code at these spots.
Steps to reproduce#
- Set the default runtime mode to Auto.
- Start an Antigravity thread with a prompt that runs several shell commands (for example, "audit this repo, list files and inspect the SQLite DB").
- While the turn is running, switch the thread's mode to Full access, optionally while sending a follow-up message into the turn.
- The same turn keeps raising a command approval card for every shell command. Starting a new turn after the current one ends stops the prompts.
Version#
0.1.12-nightly.20261120.5009 (desktop app and local server, commit f0a2aa10)
Environment#
macOS (darwin arm64, 27.0.0), Node v24.22.1, Antigravity agy 1.5.13, model gemini-4-neon, desktop app with a local server
Evidence#
# server.trace.ndjson (orchestration commands for the thread, UTC)
19:51:23 thread.create (runtime mode = settings default "auto")
19:51:37 runtime-request.respond # run 1
19:52:41 message.dispatch restart-continuation -> run 2 starts 19:52:45
19:53:50 runtime-request.respond
19:54:09 message.dispatch user steer into run 2
19:54:09 thread.runtime-mode.set -> full-access
19:54:14 runtime-request.respond
19:54:36 runtime-request.respond
19:55:49 runtime-request.respond
19:56:03 runtime-request.respond
19:57:50 runtime-request.respond
19:58:04 runtime-request.respond
20:02:41 runtime-request.respond
# orchestration_v2_projection_runtime_requests for the thread
9 rows, all kind=command, decision=accept, same providerSessionId;
the last 7 are in run 2, which started before the mode switch.
# provider events log: no session/set_mode or set_config_option at 19:54:09
# (expected, since antigravitySessionMode keeps agy in "default" for yolo)
Related issues#
#38806 (Antigravity asks for approval on T3's own MCP tools in Auto-accept edits). That one is about MCP tool approval under a fixed mode; this one is about a mode change not reaching the running turn. Different cause, not a duplicate. #6517 (closed) was a hang when changing runtime mode mid-turn; also a different symptom.
Fix applied or workaround#
Nothing was changed on the machine. Workaround: after switching to Full access, stop the current turn and send a new message, so the next turn starts under the new mode.
Filed by#
Claude Code (claude-opus-5-5) via t3 triage
vivekkairi(GitHub profile, opens in a new tab) added labelsvia-triage
tanstack-source added labelsbug
+1, running into this as well.
Environment: T3 Code
0.1.11, macOS arm64, managed Antigravity CLI1.5.13(gemini-4-neon, Google OAuth sign-in).What happens:
- Start an Antigravity thread in
Automode and hit repeated approval prompts mid-turn. - Switch the thread's permission mode to
Full accesswhile the turn is still running so it stops prompting. - The composer shows
Full access, but the active turn does not pick up the change and keeps prompting until the turn ends and a new turn starts.
Applying the updated runtime policy to the running turn (and auto-resolving any already-pending approval card that
Full accessnow allows) would fix the main workaround people reach for whenAutogets stuck on prompts.- Start an Antigravity thread in
Experiencing the same thing with same config as above
Another occurrence, with one long turn, so the effect lasted much longer than a few minutes.
Environment: T3 Code
0.1.12-nightly.20261124.5209(desktop, macOS 26.6.2 arm64), Antigravity CLIagy1.5.17 (oauth-personal),gemini-4-neon.Timeline (from
orchestration_eventsand the agy ACP log):- 00:32Z: the thread switches provider to Antigravity in Auto. Run 4 starts, and agy logs
Session … mode set to auto. - 01:36Z:
thread.runtime-mode-updated→full-access. The composer shows Full access from then on. - Run 4 is still the same turn about 14 hours later (the agent keeps going with background training jobs). Every out-of-workspace
write_file/edit_filesince then has still raised an "Allow once" card. agy logsagy_tool_safety triggered=true, reason="unsupported_tool: write_file"/"absolute_path", thenTool confirmation … approved=trueonce someone clicks. One card waited about 13 hours overnight before anyone saw it. - Follow-up messages sent while that turn ran (runs 5–7) were queued and then cancelled, so no new turn ever started to pick up Full access.
So with a long-lived Antigravity turn, "takes effect next turn" can mean "never". #39892 would fix this; until then, a UI hint that the running turn still uses the old mode would have saved a lot of clicking.
Workaround that helps here: agy honors global grants in the T3-managed profile's
config/config.json(<T3 userdata>/providers/antigravity/<profile>/config/config.json). Adding"userSettings": {"globalPermissionGrants": {"allow": ["write_file(/abs/work/dir)"]}}makes agy stop asking for writes under that directory, whatever T3's mode. Verified with a new session writing into a non-git directory outside the workspace: noTool confirmationwas logged.- 00:32Z: the thread switches provider to Antigravity in Auto. Run 4 starts, and agy logs
Sign in to join this conversation.
Hit this as well on macOS 27.2.1 (arm64), T3 Code
0.1.12-nightly.20261122.5098, managedantigravityCLI1.5.14,gemini-4-neon(shell commands hitting macOS Seatbelt and retrying withBypassSandbox: truecontinued surfacing "Allow once" cards after switching the thread to Full access).Two small follow-up notes after reviewing PR #39892:
AcpAdapterV2.applyRuntimePolicyupdateslatestRuntimePolicyandactiveTurn.input.runtimePolicyfor subsequentsession/request_permissionrequests in the running turn, but any approval card that is already pending when the user raises the thread tofull-accessstays blocked waiting for a manual click. Auto-resolving (or re-evaluating) pending approval requests whose new disposition is"allow"would complete the mid-turn upgrade UX.supportsRuntimeModeSwitchInSession, while #40447 (Option B for #39029) setssupportsRuntimeModeSwitchInSession: falsefor Antigravity so it can respawn without--dangerously-skip-permissionson downgrade. Worth keeping in mind if both land together.