t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Steering an Antigravity ACP turn while ask_question is pending fails with "Provider turn failed." and wedges the session

Open Popcornnnnnnnn opened this issue 4 days ago • 3 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate for manual user steer (related: #40534 which was closed as not planned after a 429 quota error during live repro, and #41049 for delegated task completion).
  • [x] I included enough detail to reproduce or investigate the problem.

Area

packages/provider-acp

Steps to reproduce

  1. Start a thread using the Antigravity ACP provider (4 Neon High / gemini-4-neon).
  2. Prompt the agent so that it calls ask_question (T3 Code displays Input requested and pauses the turn waiting for user input).
  3. Without answering the question, send a Steer message from the composer.
  4. After the turn fails, send a follow-up message in the same thread.

Expected behavior

  • Steering while pendingRuntimeRequests (a pending question or permission request) is open should be declined (ProviderAdapterSteerDeclinedError) so the message is queued as a follow-up and the pending question remains open.
  • Additionally, if an ACP prompt fails because the session is still waiting on a permission/question answer (or when finalizeTurn cancels pending runtime requests on failure), T3 Code should not leave the underlying ACP session wedged for subsequent startTurn calls.

Actual behavior

  1. AcpAdapterV2.steerWithPrompt sends a second session/prompt to the Antigravity ACP session while ask_question is still awaiting an answer.
  2. Antigravity ACP rejects it immediately (~1.9 ms): Error: Can't add this prompt to session <session-id>: the running prompt is waiting for a permission or question answer; answer it or send session/cancel, then send this prompt again
  3. T3 Code fails the turn with Provider error: Provider turn failed. and cancels the pending user_input_request locally without sending session/cancel or restarting the runtime.
  4. Subsequent user messages (startTurn) on the same thread immediately fail (~1.2 ms) with the exact same error because the ACP session is still waiting on the unanswered question.

Version

T3 Code Desktop 0.1.13 (macOS)

Logs

span: session/prompt (exit: Failure, durationMs: 1.875125)
Error: Can't add this prompt to session <session-id>: the running prompt is waiting for a permission or question answer; answer it or send session/cancel, then send this prompt again
    at AcpAdapterV2.steerWithPrompt
    at AcpAdapterV2.steerTurn
    at ProviderTurnControlService.steer
    at OrchestrationEffectExecutorV2.execute

# Subsequent message ~70s later:
span: session/prompt (exit: Failure, durationMs: 1.16375)
Error: Can't add this prompt to session <session-id>: the running prompt is waiting for a permission or question answer; answer it or send session/cancel, then send this prompt again
    at AcpAdapterV2.startTurn
    at ProviderTurnStartService.startWithHandoffs
    at RunExecutionService.startRootRun
    at ProviderTurnStartService.start

Popcornnnnnnnn avatar Nov 28 '26 05:11 Popcornnnnnnnn

Running into this a lot with Neon.

ninbura avatar Nov 29 '26 17:11 ninbura

Confirmed on Windows (x64) with managed Antigravity ACP (agy 1.5.20), model gemini-pro-orchestrator-neon (based on upstream commit bc0f04da94), via a third trigger path: cross-thread t3_thread_send (mode: "auto") from another top-level thread.

Observed sequence (from server.trace.ndjson and thread provider log)

  1. An active Antigravity turn called ask_question and paused waiting for user input.
  2. Eleven seconds later, another top-level thread sent an MCP t3_thread_send (mode: "auto"), which routed into active-turn steering (AcpAdapterV2.steerWithPrompt -> second session/prompt).
  3. agy 1.5.20 rejected the prompt with AcpRequestError:
    Error: Can't add this prompt to session <session-id>: the running prompt is waiting for a permission or question answer; answer it or send session/cancel, then send this prompt again
    
  4. T3 Code marked the turn failed (Provider turn failed.) and cancelled the user_input_request locally (pendingRequestCount: 0) without sending session/cancel to agy.
  5. Every subsequent user message (five retries, including after switching models to gemini-4-neon and back via session/set_config_option) failed in ~4–6 ms in AcpAdapterV2.startTurn with the exact same AcpRequestError.

Workaround confirmed

Stopping only the agy.exe process bound to that session allowed the next message to spawn a fresh agy process and resume the conversation without losing context.

Notes on fix

Declining steerWithPrompt with ProviderAdapterSteerDeclinedError while pendingRuntimeRequests.size > 0 (as in #44749 / #45318) handles t3_thread_send (mode: "auto"), delegated-task wakeups (#41049), and manual UI steers through the same EffectWorker queue fallback, and cancelling open prompts when a raced steer fails prevents the session from wedging.

needanotheremailid avatar Dec 01 '26 01:12 needanotheremailid

Adding a quick implementation note from tracing and fixing this locally on 0.1.14-nightly.20261201.5550 / .5580:

Returning ProviderAdapterSteerDeclinedError from steerWithPrompt when pendingRuntimeRequests.size > 0 (matching packages/provider-cursor/src/server/adapter.ts:3617) is currently swallowed by steerTurn's mapError in packages/provider-acp/src/server/adapter.ts (~11811), which wraps everything except ProviderAdapterSteerRunUnsupportedError into ProviderAdapterSteerRunError. Passing ProviderAdapterSteerDeclinedError through there lets ProviderTurnControlService / EffectWorker requeue the steer cleanly behind the active turn.

Also worth noting for the race window: if a steer arrives just as the card opens and session/prompt returns Antigravity's refusal (the running prompt is waiting for a permission or question answer; answer it or send session/cancel, then send this prompt again), followPrompt has already incremented promptSequence and catchCause calls finalizeTurn(context, "failed"), dismissing the card while the original prompt is still alive. Handing promptSequence back to the live prompt instead of failing the turn avoids wedging the session.

bobjoemama avatar Dec 02 '26 09:12 bobjoemama