Repository navigation
Description
What happened
After starting Antigravity sign-in in provider settings while several Antigravity threads were actively running:
- On one thread whose last agent action was requesting user input, the input popup never appeared and sending a message failed with an error about the provider session not being active.
- All active Antigravity threads became stuck in the running state and failed on every message send with:
Provider session provider-session:provider-instance:antigravity:thread:<thread-id>:<session-id> is not active.
Diagnosis
Releasing an active ACP provider session (ProviderSessionManager.releaseEntry) races with RunExecutionService's failure cleanup, causing AcpAdapterV2.interruptTurn to exit with Exit.Interrupted. RunExecutionService lets that interrupt escape without calling writeFinalRunEvents, stranding every in-flight run in status: "running" after its live session is gone.
Exact sequence in v0.1.11 (59651c1761, still present on main @ ad1b1f9ca4):
- Session teardown starts: Starting sign-in (
provider.auth.start→AntigravityAuth.runSignIn,apps/server/src/provider/AntigravityAuth.ts:331-333) callsProviderAuthService.stopSessions(apps/server/src/provider/ProviderAuthService.ts:99-155), which callsproviderSessions.release({ providerSessionId, reason: "manual_shutdown", detail: "Provider sign-in changed." })for every active session on that provider instance. - Scope closes immediately after failing subscribers:
ProviderSessionManager.releaseEntry(apps/server/src/orchestration-v2/ProviderSessionManager.ts:1361-1424) removes the live entry, callsfailSubscribers(emittingProviderAdapterEventStreamErrorwithraisedByT3: true), and immediately startscloseScopeWithin(entry.scope, ...)— whereentry.scopeisAcpAdapterV2'ssessionScope(packages/provider-acp/src/server/adapter.ts:2015). It then persistsprovider-session.updated(status: "stopped") andwriteReleasedRuntimeRequestEvents(cancelling any pendinguser_inputrequest — which is why the input popup vanished on<thread-1>right as it was opened). RunExecutionServicecallsinterruptTurnduring teardown: On each affected thread (~0.6–1.1 ms aftercloseScopeWithinstarts),RunExecutionService'sproviderEventFiber(apps/server/src/orchestration-v2/RunExecutionService.ts:1976-2197) entersEffect.catchCauseIf((cause) => !Cause.hasInterruptsOnly(cause), ...)(:2018-2020). Before callingwriteFinalRunEvents(:2131), lines:2082-2115unconditionally invokeinput.session.interruptTurn({ providerThread, providerTurnId, requestRuntimeRestart: true })(even thoughraisedByT3 === trueand T3 is already closing the session), with only:Effect.catchCauseIf( (interruptCause) => !Cause.hasInterruptsOnly(interruptCause), ... )
AcpAdapterV2.interruptTurnexitsInterrupted:AcpAdapterV2.interruptTurn(packages/provider-acp/src/server/adapter.ts:10007-10315) takesruntimeTransitionPermit, forkstransitionFiberviaEffect.forkIn(sessionScope, { startImmediately: true, uninterruptible: true })(:10309), and joins it (restore(Fiber.join(transitionFiber)),:10311). BecausesessionScopeis already closed/closing,forkInreturns an immediately-interrupted fiber (never running itsEffect.ensuring(runtimeTransitionPermit.release(1))), andFiber.joinexits in<1 mswithExit.Interrupted(InterruptError: All fibers interrupted without error).- Cleanup aborts before finalizing the run: Because
RunExecutionService.ts:2093only catches!Cause.hasInterruptsOnly(interruptCause), the adapter's closed-scope interrupt escapes both the inner and outerEffect.catchCauseIfhandlers and killsproviderEventFiberbeforewriteFinalRunEvents(:2131) executes. - Every affected thread is stranded: The runs, run attempts, and provider turns remain permanently
runningwhile their provider sessions arestoppedand absent fromProviderSessionManager. Subsequent message sends route throughOrchestrator.dispatchSteerIntoRun(apps/server/src/orchestration-v2/Orchestrator.ts:6252-6372) and fail at:6370withProvider session <id> is not active..
Note: This happened 3-for-3 across every Antigravity thread that had an in-flight turn when sign-in was started, and both sides of the bug remain unchanged on main (ad1b1f9ca4). Fixing it cleanly likely needs both:
AcpAdapterV2.interruptTurnnot leakingruntimeTransitionPermitor returningExit.Interruptedto an uninterrupted caller whensessionScopeis already closed or closes concurrently during the transition.RunExecutionServicenot callinginterruptTurnwhenraisedByT3 === true(the session is already being torn down by T3) and/or ensuring an adapter-originated interrupt cannot abortwriteFinalRunEventswhen the ingestion fiber itself was not interrupted.
Steps to reproduce
- Start one or more active runs on an ACP-backed provider (e.g., Antigravity) so at least one turn is in flight (optionally with one thread waiting on a pending
user_inputelicitation). - Open Settings → Providers → Antigravity and start Sign in (
provider.auth.start), which invokesProviderAuthService.stopSessions→ProviderSessionManager.release(..., { reason: "manual_shutdown", detail: "Provider sign-in changed." }). - Return to the previously running thread(s).
- Observe that any pending
user_inputprompt has been cancelled and no popup is shown, yet the thread still appearsrunning.
- Observe that any pending
- Send a message on any of those threads.
- Observe
Provider session provider-session:provider-instance:antigravity:thread:<thread-id>:<session-id> is not active.
- Observe
Version
0.1.11 (Desktop app with local server; commit 59651c1761; verified still present on main @ ad1b1f9ca4)
Environment
macOS 15.8.1 (darwin arm64, 24.6.0), Node v24.22.1, T3 Code Desktop 0.1.11 (local server), Antigravity provider (gemini-4-neon, runtimeMode: auto)
Evidence
# Server trace (UTC) — all 3 active Antigravity threads hit the same sequence 3-for-3
06:30:47.599Z ws.rpc.provider.auth.start exit=Success
# Session 1 (<thread-1>, also had pending user_input elicitation from 06:26:08.605Z)
06:30:47.642530Z ProviderSessionManager.removeLiveEntry exit=Success
06:30:47.642627Z ProviderSessionManager.failSubscribers exit=Success
06:30:47.642633Z ProviderSessionManager.closeScopeWithin started (finished 06:30:48.654Z, 1012ms)
06:30:47.643021Z AcpSessionRuntime.recordTermination exit=Success
06:30:47.643990Z AcpAdapterV2.interruptTurn exit=Interrupted (0.27ms) cause=InterruptError: All fibers interrupted without error
06:30:48.651477Z elicitation/create exit=Interrupted
06:30:48.675390Z ProviderSessionManager.writeReleasedRuntimeRequestEvents exit=Success
# Session 2 (<thread-2>)
06:30:48.678856Z ProviderSessionManager.removeLiveEntry exit=Success
06:30:48.678928Z ProviderSessionManager.failSubscribers exit=Success
06:30:48.678935Z ProviderSessionManager.closeScopeWithin started (finished 06:30:49.754Z, 1075ms)
06:30:48.679078Z AcpSessionRuntime.recordTermination exit=Success
06:30:48.679603Z AcpAdapterV2.interruptTurn exit=Interrupted (0.02ms) cause=InterruptError: All fibers interrupted without error
# Session 3 (<thread-3>)
06:30:49.769854Z ProviderSessionManager.removeLiveEntry exit=Success
06:30:49.769942Z ProviderSessionManager.failSubscribers exit=Success
06:30:49.769952Z ProviderSessionManager.closeScopeWithin started (finished 06:30:50.310Z, 540ms)
06:30:49.770075Z AcpSessionRuntime.recordTermination exit=Success
06:30:49.770785Z AcpAdapterV2.interruptTurn exit=Interrupted (0.06ms) cause=InterruptError: All fibers interrupted without error
06:30:50.324705Z ProviderAuthService.stopSessions exit=Success
# Orchestration events afterwards:
# All 3 threads recorded provider-session.updated (status: "stopped") at 06:30:48.757Z / 06:30:49.857Z / 06:30:50.412Z
# (<thread-1> also recorded runtime-request.updated status: "cancelled" at 06:30:48.770Z),
# with NO run.updated / run-attempt.updated / provider-turn.updated terminal events until manual Stop ~32 minutes later.
# Sending any message in the meantime failed with:
# Provider session provider-session:provider-instance:antigravity:thread:<thread-id>:<session-id> is not active.Related issues
- [Bug]: Grok thread stays running forever after t3_worktree_handoff; later messages stay queued #35274 and open PR fix(server): Grok hand-off turns settle after the worktree changes #35390 cover the closed-
sessionScopeEffect.forkInleak inAcpAdapterV2.interruptTurnduring a Grokt3_worktree_handoff(ProviderSessionManager.detach). This is broader and distinct: (1) it hits all active ACP threads simultaneously viaProviderAuthService.stopSessions/ProviderSessionManager.releaseEntry, (2) it strands runs on the firstinterruptTurncall becauseRunExecutionService.ts:2093's!Cause.hasInterruptsOnlyguard lets the adapter's interrupt abort the handler beforewriteFinalRunEvents, and (3) checking onlysessionScope.state._tag === "Closed"(as in fix(server): Grok hand-off turns settle after the worktree changes #35390) still leaves a race ifsessionScopecloses concurrently whiletransitionFiberis forked into it, and still leavesRunExecutionServicecallinginterruptTurnon a session T3 is already releasing (raisedByT3: true). - Claude session idle-released while its run waits on a delegate_task child; Stop and Settle then fail permanently #15173 (closed) produced the same
Provider session ... is not active.error from a different root cause (Claude idle-session release while waiting on a delegated child).
Fix applied or workaround
Pressing Stop manually on each affected thread cleanly interrupted the stranded runs and unblocked sending new messages without restarting the server.
Filed by
Gemini 4 Neon (Antigravity harness in T3 Code) via t3 triage
Activity