Skip to content

Runtime mode changed mid-turn doesn't apply to the running turn, so Antigravity keeps asking for approval under Full access #39866

Open

Description

@vivekkairi

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.

  1. The thread started in Auto (defaultRuntimeMode: auto). For Antigravity, Auto sends every non-denied permission request to the user on purpose. antigravityPermissionDisposition turns allow into ask when runtimeMode === "auto" (apps/server/src/provider/acp/AntigravityAcpSupport.ts:184-191). That part works as designed.

  2. Switching to Full access mid-turn never reaches the running turn. Antigravity declares supportsRuntimeModeSwitchInSession: true (AntigravityAdapterV2.ts:65), so thread.runtime-mode.set keeps 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

  1. Set the default runtime mode to Auto.
  2. Start an Antigravity thread with a prompt that runs several shell commands (for example, "audit this repo, list files and inspect the SQLite DB").
  3. While the turn is running, switch the thread's mode to Full access, optionally while sending a follow-up message into the turn.
  4. 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 f0a2aa1)

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

Activity

  1. added
    via-triage
    on Nov 20, 2026
  2. denisbetsi commented on Nov 22, 2026

    @denisbetsi

    Hit this as well on macOS 27.2.1 (arm64), T3 Code 0.1.12-nightly.20261122.5098, managed antigravity CLI 1.5.14, gemini-4-neon (shell commands hitting macOS Seatbelt and retrying with BypassSandbox: true continued surfacing "Allow once" cards after switching the thread to Full access).

    Two small follow-up notes after reviewing PR #39892:

    1. Already-pending approval cards: In PR fix(server): a runtime mode switched mid-turn applies to the running ACP turn #39892, AcpAdapterV2.applyRuntimePolicy updates latestRuntimePolicy and activeTurn.input.runtimePolicy for subsequent session/request_permission requests in the running turn, but any approval card that is already pending when the user raises the thread to full-access stays 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.
    2. Interaction with fix(composer): persist permission mode picks without sending a message #40577 and fix(server): Antigravity subagents in Full access no longer time out on hidden permission prompts #40447: fix(composer): persist permission mode picks without sending a message #40577 gates immediate mid-turn persistence of composer permission picks on supportsRuntimeModeSwitchInSession, while fix(server): Antigravity subagents in Full access no longer time out on hidden permission prompts #40447 (Option B for [Bug]: Antigravity CLI detached subagents time out waiting for permissions in Full access #39029) sets supportsRuntimeModeSwitchInSession: false for Antigravity so it can respawn without --dangerously-skip-permissions on downgrade. Worth keeping in mind if both land together.
  3. ondrej-merkun commented on Nov 23, 2026

    @ondrej-merkun

    +1, running into this as well.

    Environment: T3 Code 0.1.11, macOS arm64, managed Antigravity CLI 1.5.13 (gemini-4-neon, Google OAuth sign-in).

    What happens:

    • Start an Antigravity thread in Auto mode and hit repeated approval prompts mid-turn.
    • Switch the thread's permission mode to Full access while 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 access now allows) would fix the main workaround people reach for when Auto gets stuck on prompts.

  4. AriMKatz commented on Nov 24, 2026

    @AriMKatz

    Experiencing the same thing with same config as above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    via-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions