Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): keep completed replies visible when background wakes follow in the same run #40559

Openmkantautas(GitHub profile, opens in a new tab)wants to merge 15 commits intomain fromrefs/pull/40559/headopened View on GitHub

Showing 3 changed files with 197 additions and 0 deletions (loading 2).

x
0 of 3 viewed, 3 left
197 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsModified
View file
@@ -7862,6 +7862,203 @@
}).pipe(Effect.provide(layerTest)),
+ it.effect(
+ "keeps final_answer on a continuation reply when a carried-over subagent completes before usage_update",
+ () =>
+ Effect.gen(function* () {
+ const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
+ const idAllocator = yield* IdAllocator.IdAllocatorV2;
+ const selfInvocation = yield* resolveSelfInvocation();
+ const mockAgentPath = yield* bundledMockAgentPath;
+ const instanceId = ProviderInstanceId.make("acp-test");
+ type RuntimeService = AcpSessionRuntime.AcpSessionRuntime["Service"];
+ let sessionUpdateHandler: Parameters<RuntimeService["handleSessionUpdate"]>[0] | undefined;
+ let subagentPhase: "spawn" | "complete" = "spawn";
+ const continuationRequests: Array<ProviderContinuationRequests.ProviderContinuationRequest> =
+ [];
+ const promptSettled = yield* Deferred.make<void>();
+ const adapter = yield* makeAcpAdapterV2({
+ testHooks: {
+ afterPromptSettledWithBackgroundWork: () =>
+ Deferred.succeed(promptSettled, undefined).pipe(Effect.asVoid),
+ },
+ instanceId,
+ flavor: {
+ driver: ACP_TEST_DRIVER,
+ capabilities: AcpProviderCapabilitiesV2,
+ deferFinalizeForBackgroundWork: true,
+ enablePostSettleContinuation: true,