From bce04e685086b87f14962f0cb8586578c4ccedd3 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 20 Nov 2026 14:21:02 +0000 Subject: [PATCH 1/3] test(server): an Antigravity wake run that keeps working accepts a steer Fails on main: steerWithPrompt declines every steer while promptSequence is 0, so a continuation run that works for minutes cannot be steered. Co-Authored-By: Claude Opus 5.5 --- .../Adapters/AntigravityAdapterV2.test.ts | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts index c1f3b72b77f93..893416db1c009 100644 --- a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts @@ -1414,6 +1414,63 @@ describe("AntigravityAdapterV2 work after the prompt ends", () => { }).pipe(Effect.provide(layerSession)), ); + // A wake run has no prompt of its own, yet agy can keep working in it for minutes. + it.effect("steers a continuation run that keeps working after its wake", () => + Effect.gen(function* () { + const opened = yield* openSessionWithRunningCommand( + { IsDaemon: true, WaitMsBeforeAsync: 500 }, + undefined, + { agentVersion: "1.5.11", holdsFirstPrompt: false }, + ); + const { session, providerThread, command, offers, send, startTurn, until, throughTerminal } = + opened; + yield* startTurn(1, false); + yield* throughTerminal; + yield* send({ + sessionUpdate: "tool_call_update", + ...command, + status: "completed", + rawOutput: { output: "Command exited with code 0.", exit_code: 0 }, + }); + assert.lengthOf(offers, 1, "the finished daemon must wake the thread"); + yield* offers[0]!.dispatchIfCurrent!(Effect.void); + yield* startTurn(2, true); + const followUp = { toolCallId: "call_build", kind: "execute", title: "vp run build" }; + yield* send({ sessionUpdate: "tool_call", ...followUp, status: "in_progress" }); + const continued = yield* until( + (event) => + event.type === "turn_item.updated" && + event.turnItem.nativeItemRef?.nativeId === followUp.toolCallId, + ); + const providerTurnId = continued.flatMap((event) => + event.type === "provider_turn.updated" ? [event.providerTurn.id] : [], + )[0]!; + + const steer = yield* session + .steerTurn({ + threadId: ThreadId.make("thread-antigravity-wake"), + runId: RunId.make("run-antigravity-wake-2"), + providerThread, + providerTurnId, + message: { + messageId: MessageId.make("message-antigravity-steer"), + text: "Skip the build", + attachments: [], + createdBy: "user", + creationSource: "web", + }, + }) + .pipe(Effect.exit); + assert.isTrue( + Exit.isSuccess(steer), + `a working wake run must accept a steer: ${String(Exit.isFailure(steer) && steer.cause)}`, + ); + assert.equal(opened.cancels(), 0, "a steer must not cancel the agent's work"); + assert.lengthOf(opened.prompts, 2); + assert.deepEqual(opened.prompts[1]!.prompt, [{ type: "text", text: "Skip the build" }]); + }).pipe(Effect.provide(layerSession)), + ); + it.effect("steers a run held open by a detached subagent without stopping it", () => Effect.gen(function* () { const fileSystem = yield* FileSystem.FileSystem; From 24dfa42303052ca918e355b2295bb72595f2de2d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 20 Nov 2026 14:37:57 +0000 Subject: [PATCH 2/3] fix(server): Antigravity wake runs accept steers again A run Antigravity starts itself after background work sends no session/prompt, so steerWithPrompt declined every steer for the whole run and the message bounced back to the queue. A steer already reopens a settled turn, so a run with no prompt of its own needs no special case. Fixes pingdotgg/t3code#39746 Co-Authored-By: Claude Opus 5.5 --- packages/provider-acp/src/server/adapter.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/provider-acp/src/server/adapter.ts b/packages/provider-acp/src/server/adapter.ts index 9af7a307d6efb..562e794a38546 100644 --- a/packages/provider-acp/src/server/adapter.ts +++ b/packages/provider-acp/src/server/adapter.ts @@ -9553,14 +9553,6 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* ( detail: `Provider turn ${turnInput.providerTurnId} is not active and cannot be steered.`, }); } - // A wake turn has no prompt of its own to steer; its reply ends the run soon. - if (context.promptSequence === 0) { - return yield* new ProviderAdapter.ProviderAdapterSteerDeclinedError({ - driver, - providerThreadId: turnInput.providerThread.id, - providerTurnId: turnInput.providerTurnId, - }); - } const generation = yield* Ref.get(runtimeCallbackGeneration); const checkPromptOutcome = flavor.watchPromptOutcome === undefined @@ -9967,8 +9959,7 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* ( (effect, turnInput) => effect.pipe( Effect.mapError((cause) => - cause._tag === "ProviderAdapterSteerRunUnsupportedError" || - cause._tag === "ProviderAdapterSteerDeclinedError" + cause._tag === "ProviderAdapterSteerRunUnsupportedError" ? cause : new ProviderAdapter.ProviderAdapterSteerRunError({ driver, From 8125180372bf1f4174bef9578e4caf1209fde78d Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Fri, 20 Nov 2026 14:54:58 +0000 Subject: [PATCH 3/3] fix(server): a steered Antigravity wake run still times out when silent A wake run sends no prompt of its own, so its promptDispatched stayed pending and the inactivity watchdog a steer re-arms never started. Mark the turn's prompt dispatched once the steer prompt is sent. Co-Authored-By: Claude Opus 5.5 --- .../Adapters/AntigravityAdapterV2.test.ts | 10 ++++++++++ packages/provider-acp/src/server/adapter.ts | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts index 893416db1c009..e87b96f990466 100644 --- a/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/AntigravityAdapterV2.test.ts @@ -1468,6 +1468,16 @@ describe("AntigravityAdapterV2 work after the prompt ends", () => { assert.equal(opened.cancels(), 0, "a steer must not cancel the agent's work"); assert.lengthOf(opened.prompts, 2); assert.deepEqual(opened.prompts[1]!.prompt, [{ type: "text", text: "Skip the build" }]); + + yield* send({ sessionUpdate: "tool_call_update", ...followUp, status: "completed" }); + yield* TestClock.adjust("16 minutes"); + const silent = yield* until((event) => event.type === "turn.terminal"); + const terminal = silent.at(-1); + assert.equal( + terminal?.type === "turn.terminal" && terminal.status, + "failed", + "a silent steer prompt must still hit the inactivity timeout", + ); }).pipe(Effect.provide(layerSession)), ); diff --git a/packages/provider-acp/src/server/adapter.ts b/packages/provider-acp/src/server/adapter.ts index 562e794a38546..d25274bb9a4ce 100644 --- a/packages/provider-acp/src/server/adapter.ts +++ b/packages/provider-acp/src/server/adapter.ts @@ -9539,7 +9539,7 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* ( text, turnInput.message.attachments, ); - const dispatched = yield* runtimeTransitionPermit.withPermit( + const [dispatched, context] = yield* runtimeTransitionPermit.withPermit( Effect.gen(function* () { const context = yield* Ref.get(activeTurn); if ( @@ -9616,10 +9616,12 @@ export const makeAcpAdapterV2 = Effect.fn("makeAcpAdapterV2")(function* ( detail: `Provider turn ${turnInput.providerTurnId} ended before it could be steered.`, }); } - return dispatched; + return [dispatched, context] as const; }), ); yield* Deferred.await(dispatched); + // A wake run sent no prompt, so its inactivity watchdog waits for this one. + yield* Deferred.succeed(context.promptDispatched, undefined); }); yield* Effect.addFinalizer(() =>