From 2c3630af384d33201d18c7cf30d2c1ffdb80d27e Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Thu, 8 Oct 2026 22:32:14 -0700 Subject: [PATCH] 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 --- .../provider-pi/src/server/adapter.test.ts | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/provider-pi/src/server/adapter.test.ts b/packages/provider-pi/src/server/adapter.test.ts index ff9486cb854c..5bf1e7beea92 100644 --- a/packages/provider-pi/src/server/adapter.test.ts +++ b/packages/provider-pi/src/server/adapter.test.ts @@ -37,7 +37,13 @@ import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession"; import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter"; import { handoffBudget } from "@t3tools/provider-core/server/handoffBudget"; -import { makePiAdapterV2, PI_PROVIDER, type PiAdapterV2Options } from "./adapter.ts"; +import { HostProcessEnvironment } from "@t3tools/shared/hostProcess"; +import { + makePiAdapterV2, + PiAdapterV2Driver, + PI_PROVIDER, + type PiAdapterV2Options, +} from "./adapter.ts"; import { makePiRpcConnection, type PiRpcRecord } from "./rpc.ts"; const layerTest = Layer.mergeAll( @@ -326,11 +332,28 @@ const makeAdapter = Effect.fnUntraced(function* ( ? forkFake.spawner.spawn(command) : fake.spawner.spawn(command), ); + // Continuation cases go through the driver, which wires the offer from the + // environment the way production does. + if (continuationRequests !== undefined) { + return yield* PiAdapterV2Driver.create({ + instanceId: PI_INSTANCE_ID, + displayName: undefined, + enabled: true, + environment: [], + config: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] }, + }).pipe( + Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), + Effect.provideService(HostProcessEnvironment, {}), + Effect.provideService(ProviderContinuationRequests.ProviderContinuationRequests, { + ...continuationRequests, + take: Effect.never, + }), + ); + } return yield* makePiAdapterV2({ instanceId: PI_INSTANCE_ID, settings: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] }, environment: {}, - ...(continuationRequests === undefined ? {} : { continuationRequests }), }).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner)); });