Skip to content

Commit 791ebb0

Browse files
only21milclaude
andcommitted
test(server): reconcile test replaces the instance under any equality rule
The test renamed the instance without changing its config, which only counts as a replacement while reconcile compares whole entries. Change the config too, and give the fake instance real snapshot effects so the registry can wrap them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7ae060f commit 791ebb0

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎apps/server/src/provider/ProviderInstanceRegistry.test.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,13 +665,24 @@ describe("ProviderInstanceRegistry — reconcile", () => {
665665
},
666666
displayName,
667667
enabled: true,
668-
snapshot: {} as ProviderInstance["snapshot"],
668+
// Real effects, so the registry can wrap the snapshot when it builds an entry.
669+
snapshot: {
670+
getSnapshot: Effect.never,
671+
refresh: Effect.never,
672+
streamChanges: Stream.empty,
673+
} as Partial<ProviderInstance["snapshot"]> as ProviderInstance["snapshot"],
669674
orchestrationAdapter: {} as ProviderInstance["orchestrationAdapter"],
670675
textGeneration: {} as ProviderInstance["textGeneration"],
671676
});
672677

678+
// Change runtime config, not only the display name, so the edit always
679+
// replaces the instance rather than counting as cosmetic.
673680
const configWithName = (displayName: string): ProviderInstanceConfigMap => ({
674-
[reconcileInstanceId]: { driver: reconcileDriverKind, displayName, config: {} },
681+
[reconcileInstanceId]: {
682+
driver: reconcileDriverKind,
683+
displayName,
684+
config: { revision: displayName },
685+
},
675686
});
676687

677688
it.effect("stops returning a replaced instance before closing its scope", () =>
@@ -684,8 +695,8 @@ describe("ProviderInstanceRegistry — reconcile", () => {
684695
const driver: AnyProviderDriver = {
685696
driverKind: reconcileDriverKind,
686697
metadata: { displayName: "Reconcile test" },
687-
configSchema: Schema.Struct({}),
688-
defaultConfig: () => ({}),
698+
configSchema: Schema.Struct({ revision: Schema.String }),
699+
defaultConfig: () => ({ revision: "" }),
689700
create: ({ displayName }) =>
690701
Effect.gen(function* () {
691702
yield* Effect.addFinalizer(() =>

0 commit comments

Comments
 (0)