Skip to content

[Bug]: Unbounded hang during "Starting <provider>" (no timeout on ACP initialize / provider-turn.start) causes steering messages to pile up as queued #40851

Closed

Description

@AdamBanksCode

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Run T3 Code (0.1.12-nightly.20261122.5085) with an Antigravity (ACP) thread (the same steering-to-queue pileup path also occurs on Claude if startup stalls before a providerTurn starts).
  2. Trigger a fresh provider session open on the next user message (for example, right after a prior turn hits the 15-minute inactivity watchdog and restarts the agent).
  3. Have the provider child process stall before answering ACP initialize (in our case triggered by heavy host memory/swap pressure putting the spawned child into disk sleep during startup, without exiting or printing fatal stderr).
  4. Send additional follow-up messages via Enter (default deliveryIntent: "auto", which normally steers an active run).

Expected behavior

  1. Provider startup (ProviderTurnStartService, providerSessions.open, ACP initialize / session/new / session/resume, and equivalent Claude startup) should enforce a bounded startup timeout and fail/restart the hung child rather than hanging forever.
  2. If startup stalls beyond a reasonable threshold (e.g. 30–60s), the UI should indicate that startup is stalled and make clear why follow-up messages are being queued instead of steered.

Actual behavior

  1. The run stays stuck indefinitely on Starting Antigravity (Working for 50m+) with no timeout, no retry, and no error.
  2. Every subsequent message sent via Enter (deliveryIntent: "auto") is silently downgraded into a queued run (18 messages piled up over ~58 minutes).
  3. Once host memory pressure was relieved 58 minutes later, the child finally answered initialize, the active run created its providerTurn, and T3 Code immediately flushed all 18 queued messages into active steering via queued-message.promote-to-steer (command:deferred-steer:...).

Root cause observed in server runtime (apps/server/dist/runtimeLayer-*.mjs)

  • AcpAdapterV2.watchPromptInactivity starts with yield* _await(context.promptDispatched), so the 15-minute prompt inactivity watchdog only arms after session/prompt is dispatched. It never covers session startup (providerSessions.open, AcpSessionRuntime.initializeOnce / startOnce, session/new, session/resume, or ProviderTurnStartService).
  • runLoggedRequest only races the RPC effect against fatal stderrFailure, with no timeout on initialize / session setup requests.
  • In statev2.sqlite, the provider-turn.start row in orchestration_v2_effect_outbox stayed status = 'running', attempt_count = 1, lease_expires_at = NULL for the entire 58 minutes, with no provider_turn row created for the active run.
  • Meanwhile, resolveDeliveryIntent downgrades every deliveryIntent: "auto" message to { type: "queue_after_active" } whenever activeRun.status is "preparing" / "starting" or no providerTurn has status === "running" — a shared code path across both ACP providers and Claude.

Impact

Major degradation or frequent failure

Version or commit

0.1.12-nightly.20261122.5085

Environment

Server: Linux x64 (t3 serve 0.1.12-nightly.20261122.5085); Desktop client: macOS (T3 Code (Nightly) 0.1.12-nightly.20261122.5085); Providers: Antigravity ACP (gemini-4-neon) and Claude

Logs or stack traces

# Provider event log (sanitized):
# 1. Prior turn timed out normally via AcpAdapterV2.watchPromptInactivity after 15m:
[T+00:00] NTIVE: {"method":"session/prompt","status":"started"}
[T+15:00] NTIVE: {"method":"session/prompt","status":"failed","errorTag":"Interrupt"}

# 2. Next user message started a fresh session and hung indefinitely at initialize:
[T+32:13] NTIVE: {"method":"initialize","status":"started"}
# (No further provider events for ~58 minutes; outbox provider-turn.start stayed
#  status='running', attempt_count=1, lease_expires_at=NULL; 18 subsequent "auto"
#  messages queued behind the run.)

# 3. Immediately after host memory pressure cleared at T+90m:
[T+90:52] NTIVE: {"method":"session/prompt","status":"started"}  # queued messages auto-promoted via deferred steer
[T+90:52] NTIVE: {"method":"session/prompt","status":"succeeded"}

Workaround

Clicking Stop breaks the unbounded startup wait (or relieving host memory/IO pressure lets the stalled child complete initialize, after which deferred steering flushes the queued messages).

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