The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 16:45 UTC
test(provider-pi): cover continuation offers through the driver (#17407)
Julius Marminge committed
Oct 8, 2026 at 23:07 UTC
cb46c62504aca99295a4a8879644625a20685b7f
1 file changed
+25
-2
packages/provider-pi/src/server/adapter.test.ts
+25
-2
@@ -37,7 +37,13 @@ import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession";
37
import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator";
38
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
39
import { handoffBudget } from "@t3tools/provider-core/server/handoffBudget";
40
-import { makePiAdapterV2, PI_PROVIDER, type PiAdapterV2Options } from "./adapter.ts";
40
+import { HostProcessEnvironment } from "@t3tools/shared/hostProcess";
41
+import {
42
+ makePiAdapterV2,
43
+ PiAdapterV2Driver,
44
+ PI_PROVIDER,
45
+ type PiAdapterV2Options,
46
+} from "./adapter.ts";
47
import { makePiRpcConnection, type PiRpcRecord } from "./rpc.ts";
48
49
const layerTest = Layer.mergeAll(
@@ -317,11 +323,28 @@ const makeAdapter = Effect.fnUntraced(function* (
323
? forkFake.spawner.spawn(command)
324
: fake.spawner.spawn(command),
325
);
326
+ // Continuation cases go through the driver, which wires the offer from the
327
+ // environment the way production does.
328
+ if (continuationRequests !== undefined) {
329
+ return yield* PiAdapterV2Driver.create({
330
+ instanceId: PI_INSTANCE_ID,
331
+ displayName: undefined,
332
+ enabled: true,
333
+ environment: [],
334
+ config: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] },
335
+ }).pipe(
336
+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
337
+ Effect.provideService(HostProcessEnvironment, {}),
338
+ Effect.provideService(ProviderContinuationRequests.ProviderContinuationRequests, {
339
+ ...continuationRequests,
340
+ take: Effect.never,
341
+ }),
342
+ );
343
+ }
344
return yield* makePiAdapterV2({
345
instanceId: PI_INSTANCE_ID,
346
settings: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] },
347
environment: {},
324
- ...(continuationRequests === undefined ? {} : { continuationRequests }),
348
}).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner));
349
});
350