fix(llms): stop attributing the Vercel AI Gateway catalog to the Dify provider - #14339
Open
remote-controlled-man wants to merge 1 commit into
Open
remote-controlled-man wants to merge 1 commit into
remote-controlled-man wants to merge 1 commit into
Conversation
Contributor
|
PR author is not in the allowed authors list. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
N/A — small bug fix (per CONTRIBUTING, small bug fixes may be submitted directly without a prior issue).
Description
PROVIDER_IDS_MAPinsdk/packages/llms/src/providers/provider-keys.tscontained a row mapping thedifyruntime provider to thevercel-ai-gatewaygenerated catalog:Per the file's own contract,
runtimeProviderIdis for runtime providers that share their own vendor's generated catalog across transports/auth methods (e.g.openai-native/openai-codex/openai-codex-cliall reading theopenai-nativecatalog). Dify — a self-hosted workflow provider whose builtin spec declares no catalog models (modelsFactory: () => ({}),defaultModelId: "default") — has no relationship to Vercel's catalog. The row sits immediately above the identical Vercel mapping without a runtime id and was introduced in the marketplace-redesign commitc096030(#13653), all consistent with a copy-paste slip.Effect at HEAD:
resolveProviderModelCatalogKeys("dify")returns["vercel-ai-gateway", "dify"], sogetGeneratedModelsForRuntimeProvider("dify")returns the entire Vercel AI Gateway catalog. ThroughmergeKnownModels/resolveCatalogModelsin@cline/corethis surfaces in the model selectors (e.g. the Dify provider settings pane), offering hundreds of models from the Vercel AI Gateway catalog for a Dify connection and resolving wrong context-window/pricing/capability metadata for them.Fix: delete the row. The standalone
{ modelsDevKey: "vercel", generatedProviderId: "vercel-ai-gateway" }row directly below is untouched, so catalog generation and the Vercel provider itself are unchanged; with the row removed,resolveProviderModelCatalogKeys("dify")returns["dify"]and Dify correctly resolves to its own (empty) generated catalog.Test Plan
New regression test in
sdk/packages/llms/src/providers/builtins.test.ts(built-in provider metadata):expected [ 'vercel-ai-gateway', 'dify' ] to deeply equal [ 'dify' ].bun -F @cline/llms test: 873 passed, 4 skipped (baseline 872+4).bun -F @cline/core test:unit(downstream consumer of the mapping): 2443 passed; the single stable failure (task-spec-parsersymlink-escape test) reproduces identically on the unmodified base — a Windows environment artifact, unrelated to this change.bun run build:sdkandbun run types: clean.biome checkon both changed files: clean.Checklist