[Bug]: Steering an Antigravity ACP turn while ask_question is pending fails with "Provider turn failed." and wedges the session
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
- Start a thread using the Antigravity ACP provider (
4 Neon High/gemini-4-neon). - Prompt the agent so that it calls
ask_question(T3 Code displaysInput requestedand pauses the turn waiting for user input). - Without answering the question, send a Steer message from the composer.
- 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
finalizeTurncancels pending runtime requests on failure), T3 Code should not leave the underlying ACP session wedged for subsequentstartTurncalls.
Actual behavior
AcpAdapterV2.steerWithPromptsends a secondsession/promptto the Antigravity ACP session whileask_questionis still awaiting an answer.- 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 - T3 Code fails the turn with
Provider error: Provider turn failed.and cancels the pendinguser_input_requestlocally without sendingsession/cancelor restarting the runtime. - 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
Running into this a lot with Neon.
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)
- An active Antigravity turn called
ask_questionand paused waiting for user input. - Eleven seconds later, another top-level thread sent an MCP
t3_thread_send(mode: "auto"), which routed into active-turn steering (AcpAdapterV2.steerWithPrompt-> secondsession/prompt). agy 1.5.20rejected the prompt withAcpRequestError: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- T3 Code marked the turn failed (
Provider turn failed.) and cancelled theuser_input_requestlocally (pendingRequestCount: 0) without sendingsession/canceltoagy. - Every subsequent user message (five retries, including after switching models to
gemini-4-neonand back viasession/set_config_option) failed in ~4–6 ms inAcpAdapterV2.startTurnwith the exact sameAcpRequestError.
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.
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.