The best way to control Claude Code, Codex and more from any computer or phone
fix(pi): worktree handoff no longer leaves Pi threads Waiting (#38582)
Julius Marminge committed
Nov 18, 2026 at 04:23 UTC
66bc6145fe2b117a842d2172d3806474c2b16488
2 files changed
+9
packages/provider-pi/src/server/adapter.test.ts
+8
@@ -1070,6 +1070,14 @@ describe("PiAdapterV2", () => {
1070
}).pipe(Effect.scoped, Effect.provide(layerTest)),
1071
);
1072
1073
+ // Session release interrupts open tool calls, such as a worktree handoff's, only with this flag.
1074
+ it.effect("declares that its tool calls end with its process", () =>
1075
+ Effect.gen(function* () {
1076
+ const { runtime } = yield* openRuntime(yield* makeFakePi);
1077
+ assert.isTrue(runtime.backgroundTasksEndWithProcess);
1078
+ }).pipe(Effect.scoped, Effect.provide(layerTest)),
1079
+ );
1080
+
1081
it.effect("keeps native image bytes and the saved path in the prompt", () =>
1082
Effect.gen(function* () {
1083
const host = yield* ProviderHost.ProviderHost;
packages/provider-pi/src/server/adapter.ts
+1
@@ -3323,6 +3323,7 @@ export const makePiAdapterV2 = Effect.fn("makePiAdapterV2")(function* (
3323
return sessionEntity;
3324
},
3325
events: Stream.fromQueue(events),
3326
+ backgroundTasksEndWithProcess: true,
3327
hasPendingBackgroundWork: Effect.sync(() => pendingWake !== null),
3328
hasPendingBackgroundWorkForThread: (providerThread) =>
3329
Effect.sync(