Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): recover sessions after cancellation fails or stalls #21439

Openjuliusmarmingewants to merge 2 commits intotakeover/acp-resume-activation fromtakeover/antigravity-interrupt-recoveryopened View on GitHub

Showing 4 changed files with 155 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
146 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsModified
View file
@@ -12222,6 +12222,152 @@
}).pipe(Effect.provide(layerTest), Effect.scoped),
+ it.effect.each([
+ ["failed", "resume"],
+ ["unacknowledged", "resume"],
+ ["failed", "load-only"],
+ ] as const)(
+ "recovers from %s cancellation with %s support on a fresh runtime",
+ ([cancellation, sessionSupport]) =>
+ Effect.gen(function* () {
+ const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
+ const path = yield* Path.Path;
+ const idAllocator = yield* IdAllocator.IdAllocatorV2;
+ const mockAgentPath = yield* path.fromFileUrl(
+ new URL("../../../scripts/acp-mock-agent.ts", import.meta.url),
+ );
+ const protocolEvents = yield* Queue.unbounded<EffectAcpProtocol.AcpProtocolLogEvent>();
+ const promptStarted = yield* Deferred.make<void>();
+ const cancelAttempted = yield* Deferred.make<void>();
+ const instanceId = ProviderInstanceId.make("acp-cancel-failure");
+ let runtimeCount = 0;
+ const makeRuntime = makeMockRuntime({
+ childProcessSpawner,
+ mockAgentPath,
+ protocolEvents,
+ wrapRuntime: (runtime, ordinal) => {
+ runtimeCount = ordinal;
+ const sessionRuntime =