@@ -22,6 +22,7 @@ import { |
22 | 22 | } from "@t3tools/contracts"; |
23 | 23 | import * as ProviderLatestVersions from "@t3tools/provider-core/server/ProviderLatestVersions"; |
24 | 24 | import { OpenCodeSettings } from "@t3tools/provider-opencode/settings"; |
| 25 | +import { PiDriver } from "@t3tools/provider-pi/server"; |
25 | 26 | import * as McpProviderSessions from "@t3tools/provider-core/server/McpProviderSessions"; |
26 | 27 | import * as HostProcess from "@t3tools/shared/HostProcess"; |
27 | 28 | import * as DateTime from "effect/DateTime"; |
@@ -382,6 +383,30 @@ describe("ProviderInstanceRegistry — multi-instance codex slice", () => { |
382 | 383 | }).pipe(Effect.provide(layerTest)), |
383 | 384 | ); |
384 | 385 |
|
| 386 | + it.effect("restores the default Pi name after clearing a saved custom label", () => |
| 387 | + Effect.gen(function* () { |
| 388 | + const instanceId = ProviderInstanceId.make("pi-account"); |
| 389 | + const entry = { |
| 390 | + driver: PiDriver.driverKind, |
| 391 | + enabled: true, |
| 392 | + config: { ...PiDriver.defaultConfig(), binaryPath: "unused-pi" }, |
| 393 | + }; |
| 394 | + const { registry, mutator } = yield* makeProviderInstanceRegistry({ |
| 395 | + drivers: [PiDriver], |
| 396 | + configMap: { [instanceId]: { ...entry, displayName: "My Pi account" } }, |
| 397 | + }); |
| 398 | + const initial = yield* registry.getInstance(instanceId); |
| 399 | + const before = yield* initial!.snapshot.getSnapshot; |
| 400 | + expect(before.displayName).toBe("My Pi account"); |
| 401 | + |
| 402 | + yield* mutator.reconcile({ [instanceId]: entry }); |
| 403 | + |
| 404 | + const updated = yield* registry.getInstance(instanceId); |
| 405 | + const after = yield* updated!.snapshot.getSnapshot; |
| 406 | + expect(after.displayName).toBe("Pi"); |
| 407 | + }).pipe(Effect.provide(layerTest)), |
| 408 | + ); |
| 409 | + |
385 | 410 | it.effect("treats an explicit in-config enabled:false as disabling despite the envelope", () => |
386 | 411 | Effect.gen(function* () { |
387 | 412 | const staleId = ProviderInstanceId.make("codex_stale"); |
|