Skip to content

[Bug]: Antigravity CLI detached subagents time out waiting for permissions in Full access #39029

Open

Description

@DASungta

Area

apps/server

Steps to reproduce

  1. Configure Antigravity to run via the native agy CLI (1.5.12, where agy acp advertises modes: default, accept-edits, auto, plan).
  2. Start a thread in Full access (full-access).
  3. Ask the agent to launch a detached subagent via invoke_subagent (TypeName: self) that creates/edits a workspace file (write_file / edit_file) or runs a shell command (run_command).

Expected behavior

In Full access, the detached subagent can perform workspace writes and commands without hanging on hidden permission prompts, and switching the thread back to Supervised takes effect on the next turn without restarting agy.

Actual behavior

Every tool call in the detached subagent that requires permission (write_file, edit_file, run_command) sits in WAITING_FOR_USER (status = 6 in the child SQLite steps table) for 60s and times out. No session/request_permission request ever reaches T3 Code, so the user sees no approval prompt and the subagent cannot modify files or run commands.

Cause

In apps/server/src/provider/acp/AntigravityAcpSupport.ts, antigravityCliSessionMode (#33143) unconditionally downgrades both yolo (full-access) and auto_edit (auto-accept-edits) to "default":

export function antigravityCliSessionMode(modeId: string): string {
  return modeId === "yolo" || modeId === "auto_edit" ? "default" : modeId;
}

That works for parent-session tool calls because agy acp sends session/request_permission to T3, which auto-approves them according to acpPermissionDisposition. However, agy acp does not forward session/request_permission from detached subagents (invoke_subagent) to the ACP client — detached subagents inherit the agy session's own mode ("default").

Verified directly against agy 1.5.12 (oauth-personal, gemini-3.8-flash) on an isolated workspace:

  • mode = default: detached self subagent calling write_file / run_command hangs >60s (status = 6), 0 session/request_permission requests received.
  • mode = accept-edits: parent write_file succeeds with 0 permission prompts; detached self subagent write_file / edit_file still hangs in WAITING_FOR_USER on agy 1.5.12.
  • mode = auto (via session/set_config_option({ configId: "mode", value: "auto" })): detached self subagent completes both write_file and run_command within ~15s with no timeout, and hot-switching back to default on the same session succeeds without restarting agy.

Mapping yolo -> "auto" (falling back to "accept-edits" -> "default" when "auto" is not advertised in availableModes, e.g. accounts without the OS sandbox) and auto_edit -> "accept-edits" (falling back to "default"), while keeping explicit approvalPolicy / sandboxPolicy sessions in "default", resolves this without using --dangerously-skip-permissions and without conflicting with #35540 (which adds auto to supportedRuntimeModes).

Impact

Major degradation or frequent failure

Version or commit

main @ 5ec4f50 (also reproduced on v0.1.11-nightly.20261119.4918)

Environment

macOS (Darwin arm64), Node 26.13.1, agy CLI 1.5.12 (oauth-personal), gemini-3.8-flash

Activity

  1. JoshuaHayesWasHere commented on Nov 19, 2026

    @JoshuaHayesWasHere

    Note

    🤖 Gemini 4 Neon responding on behalf of JoshuaHayesWasHere

    Hit this same bug on Linux (0.1.10-nightly.20261119.13388, agy CLI 1.5.12, oauth-personal, gemini-4-neon), with an important detail for PR #39047: mode = "auto" still leaves detached invoke_subagent children hanging on out-of-workspace read_file calls.

    Evidence

    1. Incident on main (mode = "default"): A detached self subagent timed out after 60s three consecutive times on read_file for files outside the worktree (~/repos/...), and then timed out again on an in-worktree run_command. server.trace.ndjson recorded zero session/request_permission spans during the entire window while parent-session reads of the same out-of-worktree file succeeded immediately.
    2. Live test of mode = "auto" against agy 1.5.12: After setting session/set_config_option({ configId: "mode", value: "auto" }), a detached self subagent attempting read_file on a file outside the workspace still stalled in WAITING_FOR_USER (status = 6 in the child SQLite steps table) with zero session/request_permission requests forwarded to the ACP client.
    3. Live test of --dangerously-skip-permissions against agy 1.5.12:
      • Spawning agy acp --dangerously-skip-permissions allowed the detached self subagent to complete both the out-of-workspace read_file and a destructive workspace run_command (rm -f) with zero hangs.
      • ask_question (elicitation/create) and setMode("plan") still worked as expected under --dangerously-skip-permissions.
      • Because --dangerously-skip-permissions stays active even after setMode("default"), switching runtime mode out of Full access requires detaching the session (supportsRuntimeModeSwitchInSession: false), respawning agy acp without the flag, and resuming via session/resume (verified to restore session/request_permission on the resumed turn).

    Environment

    • T3 Code Desktop 0.1.10-nightly.20261119.13388 (local server)
    • OS: Linux x64 (7.3.4-arch1-2), Node v24.22.1
    • Antigravity CLI: agy 1.5.12 (oauth-personal)
  2. DASungta commented on Nov 20, 2026

    @DASungta
    ContributorAuthor

    Given the new findings here and on #39378, I want to check the preferred direction before pushing any further changes to #39053:

    1. Semantics & availability (feat(antigravity): Auto uses agy's own Auto review #39378): feat(antigravity): Auto uses agy's own Auto review #39378 is mapping agy's auto mode to T3's Auto mode (with antigravityRuntimeModeForSessionMode("auto") -> "auto"), and as tested on nucbox-1, some agy 1.5.12 personal accounts don't advertise auto at all.
    2. In-workspace vs. out-of-workspace subagents: My live macOS test on fix(server): Antigravity CLI subagents no longer time out in Full access #39053 verified in-workspace detached subagent write_file + run_command in mode = "auto", while @JoshuaHayesWasHere confirmed above that out-of-workspace read_file still hangs 60s under mode = "auto".
    3. Prior --dangerously-skip-permissions decision (fix(antigravity): use CLI permission modes and full-access flag #32875 / fix(antigravity): agy CLI threads open in Full access and Auto-accept edits #33143): fix(server): Antigravity CLI subagents no longer time out in Full access #39053 (and fix(server): agy CLI Full access sessions run in the CLI's auto mode #39047) avoided --dangerously-skip-permissions to respect fix(antigravity): agy CLI threads open in Full access and Auto-accept edits #33143 (no process restart, no open-time permission downgrade race). That trade-off assumed default always forwarded session/request_permission to T3, which doesn't hold for detached subagents.

    @juliusmarminge Which direction do you prefer for CLI Full access?

    Happy to implement whichever direction you'd like.

  3. loosekite commented on Nov 20, 2026

    @loosekite
    Contributor

    Confirming the same out-of-workspace read_file 60s timeout still reproduces on T3 Code 0.1.10 + agy 1.5.13 (Linux x64, full-access mode), even for read-only detached plugin subagents:

    • Parent thread runs in a git worktree in full-access mode and can read sibling repo files outside the worktree normally.
    • A detached read-only subagent launched via invoke_subagent calling read_file on a sibling repo path outside the worktree hangs for exactly 60s and fails with:
      permission check failed for read_file "...": Permission prompt for action 'read_file' on target '...' timed out waiting for user response after 60s
    • In multi-repo setups where a single git worktree needs read-only cross-repo inspection by parallel background subagents, Option A (mode = "auto" only) would still leave every out-of-worktree read_file stalling 60s per call — adding a data point in favor of Option B (or explicit additional readable workspace directories / upstream agy forwarding subagent session/request_permission).
  4. hchaudhary1 commented on Nov 21, 2026

    @hchaudhary1

    +1 for Option B. Still hitting the 60s timeout on out-of-workspace read_file in detached subagents on 0.1.12-nightly.20261121.5024 + agy 1.5.13 (Linux, Full access).

  5. hchaudhary1 commented on Nov 21, 2026

    @hchaudhary1

    Workaround until this is fixed: point Settings → Providers → Antigravity → Binary path at a small wrapper that runs the managed binary with acp --dangerously-skip-permissions. Subagent read_file outside the workspace then succeeds immediately. Start a new thread after saving.

  6. hqhq1025 commented on Nov 21, 2026

    @hqhq1025

    +1 for Option B — confirming this still reproduces on macOS arm64 with T3 Code 0.1.11 and managed antigravity CLI 1.5.14 (oauth-personal, gemini-4-neon, full-access mode).

    Repro (multi-repo parallel subagents)

    • Parent thread opened in repo A (full-access mode); parent agent reads/writes sibling repo B normally.
    • Launched 3 parallel detached subagents via invoke_subagent that needed to read files in sibling repo B.
    • All 3 stalled in Thinking on their very first read_file call and timed out after 60s with permission check failed for read_file "...", with no approval prompt surfaced to T3 Code.

    Because Option A (mode = "auto") still keeps out-of-workspace read_file blocked for detached subagents (and also fails on accounts/hosts where auto isn't advertised), Option B (--dangerously-skip-permissions for full-access + respawn and session/resume on downgrade) seems like the only approach that makes full-access match its expected behavior until upstream agy acp forwards subagent permission requests.

  7. denisbetsi commented on Nov 22, 2026

    @denisbetsi

    Adding two more data points in favor of Option B (PR #40447) on macOS 27.2.1 (arm64), T3 Code 0.1.12-nightly.20261122.5098, managed antigravity CLI 1.5.14, gemini-4-neon, full-access:

    1. Built-in t3-code/* MCP tool calls in native self subagents also hit the 60s hidden permission timeout. Spawning 3 parallel invoke_subagent (TypeName: self) workers to read GitHub issues/PRs via t3-code/pull_request_read failed every worker after 60s with:
      Encountered error in step execution: permission check failed for mcp "t3-code/pull_request_read": Permission prompt for action 'mcp' on target 't3-code/pull_request_read' timed out waiting for user response after 60s; the user did not respond, which is not an explicit denial.
      
      Because agy acp does not forward subagent session/request_permission requests to T3, T3's MCP pre-approval (fix(antigravity): pre-approve T3 MCP tools in Auto and Auto-accept edits #39822) never sees them. Option A (mode = "auto" in fix(server): agy CLI Full access sessions run in the CLI's auto mode #39047 / fix(server): Antigravity CLI subagents no longer time out in Full access #39053) would still leave both out-of-workspace reads and MCP tool calls timing out in detached subagents.
    2. Native research subagents calling rg outside the workspace hit the same 60s hidden permission timeout in full-access.

    (Separate note worth checking with #40447: on macOS in full-access, top-level run_command calls like swift build, Keychain-backed tests, codesign, or reading ~/Library/Application Support/... currently still hit agy's Seatbelt sandbox first and have to fail and retry with BypassSandbox: true.)

  8. adamkasper commented on Nov 22, 2026

    @adamkasper

    +1 for Option B, hitting the same 60s timeout on run_command in detached self subagents (invoke_subagent) in full-access mode.

    Environment: macOS (arm64), T3 Code 0.1.12-nightly.20261122.5098, Antigravity (gemini-4-neon, full-access).

    When spawning parallel self subagents that run simple shell commands (e.g. git rev-parse --short HEAD && (cd /tmp && npm view vue version) or gh api), every subagent stalls for 60s and fails with:

    permission check failed for unsandboxed "...": Permission prompt for action 'command' on target '...' timed out waiting for user response after 60s; the user did not respond, which is not an explicit denial.
    

    The exact same commands succeed immediately in the parent thread.

  9. denisbetsi commented on Nov 22, 2026

    @denisbetsi

    Quick follow-up confirming the Seatbelt question from above: tested a wrapper passing acp --dangerously-skip-permissions against managed antigravity 1.5.14 on macOS 27.2.1 (arm64, gemini-4-neon).

    Both the top-level agent and a native self subagent ran ls -1 "$HOME/Library/Application Support" without BypassSandbox: true and succeeded on the very first attempt (exit 0, no Seatbelt error, no retry), alongside native subagent read_file on /etc/hosts (~2s) and t3-code/read_issue MCP (~2s) with zero 60s timeouts.

    So Option B (PR #40447) fixes both the detached subagent 60s hidden-prompt timeouts (including MCP and out-of-workspace reads) and the macOS Seatbelt fail-then-retry churn in full-access.

  10. gustavosmendes commented on Nov 23, 2026

    @gustavosmendes

    Another data point, with an A/B on the same machine and build.

    Environment: macOS 27.2 (arm64), T3 Code 0.1.12-nightly.20261122.5098, managed antigravity 1.5.14 (ACP), gemini-4-neon, Full access.

    Detached self children honor the global grants in the T3-managed profile's config/config.json (<T3 userdata>/providers/antigravity/<profile>/config/config.json). The profile I tested had these settings:

    "userSettings": {
      "permissionPreset": "AGENT_PERMISSION_PRESET_TURBO",
      "autoExecutionPolicy": "CASCADE_COMMANDS_AUTO_EXECUTION_EAGER",
      "globalPermissionGrants": {
        "allow": ["command(*)", "read_file(*)", "write_file(*)", "read_url(*)", "execute_url(*)", "mcp(*)"]
      }
    }

    Both runs used the same parent prompt: the parent spawns one self child with invoke_subagent, and the child runs ssh <host> hostname and one local CLI command with run_command.

    • With command(*) in allow: both commands exit 0 in about 2–3 s, with no timeout.
    • Same file with only command(*) removed: both commands fail after 60 s with permission check failed for unsandboxed "...": Permission prompt for action 'command' on target '...' timed out waiting for user response after 60s. T3 shows no prompt. This is the same failure a real task hit on 2026-11-22 before the grant was in the file.

    Until #40447 lands, adding the grants to the managed profile's config.json works around the bug and keeps the binary's own permission handling, without a --dangerously-skip-permissions wrapper. I only tested command(*). The trade-off is that the grants apply to every thread on that profile, Supervised ones included.

    It also suggests a fix direction. Children read this file but never send session/request_permission, so for Full access threads T3 could write the matching grants into the profile it already manages.

    Posted by Claude Code (Opus 5.5) on behalf of the account owner.

  11. FLPPPPPP commented on Nov 24, 2026

    @FLPPPPPP

    Bump? is rly annoying to use Neon and T3 get stucks on workflow

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions