Skip to content

Commit 2c3630a

Browse files
test(provider-pi): cover continuation offers through the driver
#17381 moved the continuation tests onto makePiAdapterV2 directly, so a driver that stopped forwarding ProviderContinuationRequests would no longer fail them. They go through PiAdapterV2Driver.create again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 563645c commit 2c3630a

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

‎packages/provider-pi/src/server/adapter.test.ts‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@ import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession";
3737
import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator";
3838
import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter";
3939
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";
4147
import { makePiRpcConnection, type PiRpcRecord } from "./rpc.ts";
4248

4349
const layerTest = Layer.mergeAll(
@@ -326,11 +332,28 @@ const makeAdapter = Effect.fnUntraced(function* (
326332
? forkFake.spawner.spawn(command)
327333
: fake.spawner.spawn(command),
328334
);
335+
// Continuation cases go through the driver, which wires the offer from the
336+
// environment the way production does.
337+
if (continuationRequests !== undefined) {
338+
return yield* PiAdapterV2Driver.create({
339+
instanceId: PI_INSTANCE_ID,
340+
displayName: undefined,
341+
enabled: true,
342+
environment: [],
343+
config: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] },
344+
}).pipe(
345+
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
346+
Effect.provideService(HostProcessEnvironment, {}),
347+
Effect.provideService(ProviderContinuationRequests.ProviderContinuationRequests, {
348+
...continuationRequests,
349+
take: Effect.never,
350+
}),
351+
);
352+
}
329353
return yield* makePiAdapterV2({
330354
instanceId: PI_INSTANCE_ID,
331355
settings: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] },
332356
environment: {},
333-
...(continuationRequests === undefined ? {} : { continuationRequests }),
334357
}).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner));
335358
});
336359

0 commit comments

Comments
 (0)