Skip to content

fix(llms): stop attributing the Vercel AI Gateway catalog to the Dify provider - #14339

Open
remote-controlled-man wants to merge 1 commit into
cline:mainfrom
remote-controlled-man:codex/cline-dify-catalog
Open

remote-controlled-man wants to merge 1 commit into
cline:mainfrom
remote-controlled-man:codex/cline-dify-catalog

Conversation

@remote-controlled-man

Copy link
Copy Markdown

Related Issue

N/A — small bug fix (per CONTRIBUTING, small bug fixes may be submitted directly without a prior issue).

Description

PROVIDER_IDS_MAP in sdk/packages/llms/src/providers/provider-keys.ts contained a row mapping the dify runtime provider to the vercel-ai-gateway generated catalog:

{
	modelsDevKey: "vercel",
	generatedProviderId: "vercel-ai-gateway",
	runtimeProviderId: "dify",
},

Per the file's own contract, runtimeProviderId is for runtime providers that share their own vendor's generated catalog across transports/auth methods (e.g. openai-native / openai-codex / openai-codex-cli all reading the openai-native catalog). 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 commit c096030 (#13653), all consistent with a copy-paste slip.

Effect at HEAD: resolveProviderModelCatalogKeys("dify") returns ["vercel-ai-gateway", "dify"], so getGeneratedModelsForRuntimeProvider("dify") returns the entire Vercel AI Gateway catalog. Through mergeKnownModels / resolveCatalogModels in @cline/core this 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):

it("does not attribute the Vercel AI Gateway catalog to the Dify runtime provider", () => {
	expect(resolveProviderModelCatalogKeys("dify")).toEqual(["dify"]);
	expect(getGeneratedModelsForRuntimeProvider("dify")).toEqual({});
});
  • RED on base: fails with expected [ 'vercel-ai-gateway', 'dify' ] to deeply equal [ 'dify' ].
  • GREEN after the fix.
  • 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-parser symlink-escape test) reproduces identically on the unmodified base — a Windows environment artifact, unrelated to this change.
  • bun run build:sdk and bun run types: clean.
  • biome check on both changed files: clean.

Checklist

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • Changes are limited to a single feature, bugfix or chore
  • Tests are passing and code is formatted and linted (see Test Plan for the exact commands run)

Copilot AI lite review requested due to automatic review settings September 21, 2026 02:14
@greptile-apps

greptile-apps Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants