GeezerVison is showing github.com — chore(ai): drop five unused legacy provider entrypoint aliases (#59506) · abn/opencode@96ae220
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/ai/package.json -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 28 | 28 | "./providers/alibaba/messages": "./src/providers/alibaba/messages.ts", | 29 | 29 | "./providers/alibaba/responses": "./src/providers/alibaba/responses.ts", | 30 | 30 | "./providers/amazon-bedrock": "./src/providers/amazon-bedrock.ts", | 31 | | - "./providers/amazon-bedrock-mantle": "./src/providers/amazon-bedrock-mantle.ts", | 32 | 31 | "./providers/amazon-bedrock/mantle": "./src/providers/amazon-bedrock/mantle.ts", | 33 | 32 | "./providers/amazon-bedrock/mantle/chat": "./src/providers/amazon-bedrock/mantle/chat.ts", | 34 | 33 | "./providers/amazon-bedrock/mantle/messages": "./src/providers/amazon-bedrock/mantle/messages.ts", | | 63 | 62 | "./providers/fireworks": "./src/providers/fireworks.ts", | 64 | 63 | "./providers/google": "./src/providers/google.ts", | 65 | 64 | "./providers/google-vertex": "./src/providers/google-vertex.ts", | 66 | | - "./providers/google-vertex-chat": "./src/providers/google-vertex-chat.ts", | 67 | | - "./providers/google-vertex-interactions": "./src/providers/google-vertex-interactions.ts", | 68 | 65 | "./providers/google-vertex-messages": "./src/providers/google-vertex-messages.ts", | 69 | | - "./providers/google-vertex-mistral": "./src/providers/google-vertex-mistral.ts", | 70 | | - "./providers/google-vertex-responses": "./src/providers/google-vertex-responses.ts", | 71 | 66 | "./providers/google-vertex/chat": "./src/providers/google-vertex/chat.ts", | 72 | 67 | "./providers/google-vertex/gemini": "./src/providers/google-vertex/gemini.ts", | 73 | 68 | "./providers/google-vertex/images": "./src/providers/google-vertex/images.ts", | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/src/aisdk-native.ts +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -137,12 +137,21 @@ const mantle = (modelID: string | undefined) => { | 137 | 137 | return `@opencode/ai/providers/amazon-bedrock/mantle/${modelID.includes("gpt-oss") ? "chat" : "responses"}` | 138 | 138 | } | 139 | 139 |
| | 140 | +// Old hyphenated Vertex entrypoints that stale configs may still name. | | 141 | +const LEGACY_VERTEX: Readonly<Record<string, string>> = { | | 142 | + "@opencode/ai/providers/google-vertex-chat": "@opencode/ai/providers/google-vertex/chat", | | 143 | + "@opencode/ai/providers/google-vertex-responses": "@opencode/ai/providers/google-vertex/responses", | | 144 | + "@opencode/ai/providers/google-vertex-interactions": "@opencode/ai/providers/google-vertex/interactions", | | 145 | + "@opencode/ai/providers/google-vertex-mistral": "@opencode/ai/providers/google-vertex/mistral", | | 146 | +} | | 147 | + | 140 | 148 | function resolve(specifier: string, context: Context & { readonly settings?: Provider.Settings }): string | undefined { | 141 | 149 | const npm = Provider.packageName(specifier) | 142 | 150 | if (Provider.isAISDK(specifier) || npm in PACKAGES || npm in (HOSTS[context.providerID] ?? {})) | 143 | 151 | return native(npm, context) | 144 | 152 | if (npm === "@opencode/ai/providers/amazon-bedrock/mantle" || npm === "@opencode/ai/providers/amazon-bedrock-mantle") | 145 | 153 | return mantle(context.modelID) | | 154 | + if (npm in LEGACY_VERTEX) return LEGACY_VERTEX[npm] | 146 | 155 | if ( | 147 | 156 | (npm === "@opencode/ai/providers/azure" || npm === "@opencode/ai/providers/azure/responses") && | 148 | 157 | azureChat(context) | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/src/provider.ts -8Lines changed: 0 additions & 8 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -65,7 +65,6 @@ const builtins = new Map<string, () => Promise<unknown>>([ | 65 | 65 | "@opencode/ai/providers/amazon-bedrock/mantle/responses", | 66 | 66 | () => import("@opencode/ai/providers/amazon-bedrock/mantle/responses"), | 67 | 67 | ], | 68 | | - ["@opencode/ai/providers/amazon-bedrock-mantle", () => import("@opencode/ai/providers/amazon-bedrock-mantle")], | 69 | 68 | ["@opencode/ai/providers/anthropic", () => import("@opencode/ai/providers/anthropic")], | 70 | 69 | ["@opencode/ai/providers/anthropic-compatible", () => import("@opencode/ai/providers/anthropic-compatible")], | 71 | 70 | ["@opencode/ai/providers/azure", () => import("@opencode/ai/providers/azure")], | @@ -111,14 +110,7 @@ const builtins = new Map<string, () => Promise<unknown>>([ | 111 | 110 | ["@opencode/ai/providers/google-vertex/mistral", () => import("@opencode/ai/providers/google-vertex/mistral")], | 112 | 111 | ["@opencode/ai/providers/google-vertex/responses", () => import("@opencode/ai/providers/google-vertex/responses")], | 113 | 112 | ["@opencode/ai/providers/google-vertex/images", () => import("@opencode/ai/providers/google-vertex/images")], | 114 | | - ["@opencode/ai/providers/google-vertex-chat", () => import("@opencode/ai/providers/google-vertex-chat")], | 115 | | - [ | 116 | | - "@opencode/ai/providers/google-vertex-interactions", | 117 | | - () => import("@opencode/ai/providers/google-vertex-interactions"), | 118 | | - ], | 119 | 113 | ["@opencode/ai/providers/google-vertex-messages", () => import("@opencode/ai/providers/google-vertex-messages")], | 120 | | - ["@opencode/ai/providers/google-vertex-mistral", () => import("@opencode/ai/providers/google-vertex-mistral")], | 121 | | - ["@opencode/ai/providers/google-vertex-responses", () => import("@opencode/ai/providers/google-vertex-responses")], | 122 | 114 | ["@opencode/ai/providers/groq", () => import("@opencode/ai/providers/groq")], | 123 | 115 | ["@opencode/ai/providers/meta", () => import("@opencode/ai/providers/meta")], | 124 | 116 | ["@opencode/ai/providers/meta/chat", () => import("@opencode/ai/providers/meta/chat")], | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/src/variant.ts -5Lines changed: 0 additions & 5 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -610,7 +610,6 @@ const PROTOCOLS: Readonly<Record<string, Protocol>> = { | 610 | 610 | "@opencode/ai/providers/azure/responses": openaiResponses, | 611 | 611 | "@opencode/ai/providers/amazon-bedrock/mantle": openaiResponses, | 612 | 612 | "@opencode/ai/providers/amazon-bedrock/mantle/responses": openaiResponses, | 613 | | - "@opencode/ai/providers/amazon-bedrock-mantle": openaiResponses, | 614 | 613 | "@opencode/ai/providers/alibaba/responses": openaiResponses, | 615 | 614 | "@opencode/ai/providers/meta": openaiResponses, | 616 | 615 | "@opencode/ai/providers/meta/responses": openaiResponses, | @@ -621,15 +620,13 @@ const PROTOCOLS: Readonly<Record<string, Protocol>> = { | 621 | 620 | "@opencode/ai/providers/openai-compatible/responses": openResponses, | 622 | 621 | "@opencode/ai/providers/openai-compatible-responses": openResponses, | 623 | 622 | "@opencode/ai/providers/google-vertex/responses": openResponses, | 624 | | - "@opencode/ai/providers/google-vertex-responses": openResponses, | 625 | 623 | "@opencode/ai/providers/xai": openResponses, | 626 | 624 |
| 627 | 625 | "@opencode/ai/providers/openai-compatible": openaiCompatible, | 628 | 626 | "@opencode/ai/providers/openai/chat": openaiChat, | 629 | 627 | "@opencode/ai/providers/azure/chat": openaiChat, | 630 | 628 | "@opencode/ai/providers/amazon-bedrock/mantle/chat": openaiChat, | 631 | 629 | "@opencode/ai/providers/google-vertex/chat": vertexChat, | 632 | | - "@opencode/ai/providers/google-vertex-chat": vertexChat, | 633 | 630 | "@opencode/ai/providers/alibaba": alibabaChat, | 634 | 631 | "@opencode/ai/providers/alibaba/chat": alibabaChat, | 635 | 632 | "@opencode/ai/providers/baseten": basetenChat, | @@ -645,7 +642,6 @@ const PROTOCOLS: Readonly<Record<string, Protocol>> = { | 645 | 642 | "@opencode/ai/providers/minimax/chat": openaiChat, | 646 | 643 | "@opencode/ai/providers/mistral": openaiChat, | 647 | 644 | "@opencode/ai/providers/google-vertex/mistral": openaiChat, | 648 | | - "@opencode/ai/providers/google-vertex-mistral": openaiChat, | 649 | 645 | "@opencode/ai/providers/moonshot": moonshotChat, | 650 | 646 | "@opencode/ai/providers/moonshot/chat": moonshotChat, | 651 | 647 | "@opencode/ai/providers/togetherai": openaiChat, | @@ -674,7 +670,6 @@ const PROTOCOLS: Readonly<Record<string, Protocol>> = { | 674 | 670 | "@opencode/ai/providers/google-vertex/images": gemini, | 675 | 671 | "@opencode/ai/providers/google/interactions": googleInteractions, | 676 | 672 | "@opencode/ai/providers/google-vertex/interactions": googleInteractions, | 677 | | - "@opencode/ai/providers/google-vertex-interactions": googleInteractions, | 678 | 673 |
| 679 | 674 | "@opencode/ai/providers/amazon-bedrock": bedrockConverse, | 680 | 675 | "@opencode/ai/providers/cohere": cohere, | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/aisdk-native.test.ts +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -252,6 +252,13 @@ describe("AISDKNative", () => { | 252 | 252 | package: "@opencode/ai/providers/amazon-bedrock/mantle/messages", | 253 | 253 | settings: { apiKey: "token" }, | 254 | 254 | }) | | 255 | + expect(rewrite("@opencode/ai/providers/amazon-bedrock-mantle", {}, "openai.gpt-oss-120b").package).toBe( | | 256 | + "@opencode/ai/providers/amazon-bedrock/mantle/chat", | | 257 | + ) | | 258 | + for (const name of ["chat", "responses", "interactions", "mistral"]) | | 259 | + expect(rewrite(`@opencode/ai/providers/google-vertex-${name}`, {}).package).toBe( | | 260 | + `@opencode/ai/providers/google-vertex/${name}`, | | 261 | + ) | 255 | 262 | expect(rewrite("@opencode/ai/providers/azure", { useCompletionUrls: true }).package).toBe( | 256 | 263 | "@opencode/ai/providers/azure/chat", | 257 | 264 | ) | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/provider.test.ts +1-9Lines changed: 1 addition & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -26,15 +26,7 @@ describe("Provider", () => { | 26 | 26 | }) | 27 | 27 |
| 28 | 28 | test("keeps loading the hyphenated provider paths existing configs reference", async () => { | 29 | | - for (const name of [ | 30 | | - "amazon-bedrock-mantle", | 31 | | - "google-vertex-chat", | 32 | | - "google-vertex-interactions", | 33 | | - "google-vertex-messages", | 34 | | - "google-vertex-mistral", | 35 | | - "google-vertex-responses", | 36 | | - "openai-compatible-responses", | 37 | | - ]) { | | 29 | + for (const name of ["google-vertex-messages", "openai-compatible-responses"]) { | 38 | 30 | const specifier = `@opencode/ai/providers/${name}` | 39 | 31 | expect(Provider.builtinPackages.has(specifier)).toBe(true) | 40 | 32 | const loaded = await Effect.runPromise(Provider.loadPackage(specifier)) | |
|