Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(providers): resolve gateway-prefixed model slugs to their catalog entry #9383

Closedamanthanvi(GitHub profile, opens in a new tab)wants to merge 14 commits intomain fromrefs/pull/9383/headopened View on GitHub

Showing 7 changed files with 104 additions and 7 deletions (loading 5).

x
0 of 7 viewed, 7 left
62 additions and 0 deletionsapps/server/src/provider/Layers/ClaudeProvider.test.tsAdded
View file
@@ -0,0 +1,62 @@
+import { ClaudeSettings } from "@t3tools/contracts";
+import { assert, describe, it } from "@effect/vitest";
+import * as Effect from "effect/Effect";
+import * as Schema from "effect/Schema";
+​
+import {
+ SYNTHETIC_CLAUDE_CAPABLE_MODEL,
+ SYNTHETIC_CLAUDE_COLLIDING_ALIAS,
+ SYNTHETIC_CLAUDE_MODEL_CATALOG,
+ SYNTHETIC_CLAUDE_STANDARD_MODEL,
+} from "../ClaudeModelCatalog.testFixtures.ts";
+import { makePendingClaudeProvider } from "./ClaudeProvider.ts";
+​
+/**
+ * Test policy: the snapshot must stay independent of bundled manifest
+ * contents, so this file only ever names slugs from the synthetic catalog.
+ */
+​
+const decodeClaudeSettings = Schema.decodeSync(ClaudeSettings);
+​
+describe("Claude provider snapshot", () => {
+ it.effect("lends gateway-prefixed custom models the options of their template", () =>
+ Effect.gen(function* () {
+ const draft = yield* makePendingClaudeProvider(
+ decodeClaudeSettings({
+ customModels: [
+ `gateway/${SYNTHETIC_CLAUDE_CAPABLE_MODEL}`,
+ "gateway/claude-synthetic-unlisted",
+ SYNTHETIC_CLAUDE_COLLIDING_ALIAS,
+ `gateway/${SYNTHETIC_CLAUDE_COLLIDING_ALIAS}`,