Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(provider-pi): cover continuation offers through the driver #17407

Mergedjuliusmarmingemerged 1 commit intomain fromrefs/pull/17407/headmerged by juliusmarminge View on GitHub

Showing 1 changed file with 25 additions and 2 deletions.

x
0 of 1 viewed, 1 left
25 additions and 2 deletionspackages/provider-pi/src/server/adapter.test.tsModified
View file
@@ -37,7 +37,13 @@
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 @@
? 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(