Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): ACP session/load replay no longer pins background work #40328

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/40328/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 89 additions and 0 deletions (loading 1).

x
0 of 2 viewed, 2 left
89 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/AcpAdapterV2.test.tsModified
View file
@@ -9234,6 +9234,95 @@
}).pipe(Effect.provide(layerTest)),
+ it.effect("session/load replay does not leave post-settle background work pending", () =>
+ Effect.gen(function* () {
+ const childProcessSpawner = yield* ChildProcessSpawner.ChildProcessSpawner;
+ 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;
+ const adapter = yield* makeAcpAdapterV2({
+ instanceId,
+ selfInvocation,
+ flavor: {
+ driver: ACP_TEST_DRIVER,
+ capabilities: AcpProviderCapabilitiesV2,
+ enablePostSettleContinuation: true,
+ normalizeToolCall: normalizeXAiAcpToolCallState,
+ makeRuntime: makeMockRuntime({
+ childProcessSpawner,
+ mockAgentPath,
+ wrapRuntime: (runtime) => ({
+ ...runtime,
+ handleSessionUpdate: (handler) =>
+ Effect.sync(() => {
+ sessionUpdateHandler = handler;
+ }).pipe(Effect.andThen(runtime.handleSessionUpdate(handler))),
+ }),