Skip to content

fix: prevent 'Unknown provider' regression for LangChainAdapter#3840

Merged
AlemTuzlak merged 2 commits into
mainfrom
fix/issue-3217
Apr 22, 2026
Merged

fix: prevent 'Unknown provider' regression for LangChainAdapter#3840
AlemTuzlak merged 2 commits into
mainfrom
fix/issue-3217

Conversation

@jpr5

@jpr5 jpr5 commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Closes #3217

When getLanguageModel() returns null and provider/model are undefined (as with LangChainAdapter), the code constructed "undefined/undefined" as a model string, causing a cryptic "Unknown provider" error.

Now checks each source of model info explicitly and throws a clear error message directing users to provide an explicit agents config when using adapters that don't expose model metadata.

Split from #3838.

When getLanguageModel() returns null and provider/model are undefined
(as with LangChainAdapter), the code constructed "undefined/undefined"
as a model string, causing a cryptic "Unknown provider" error.

Now checks each source of model info explicitly and throws a clear
error message directing users to provide an explicit agents config
when using adapters that don't expose model metadata.
@vercel

vercel Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat-with-your-data Ready Ready Preview, Comment Apr 22, 2026 10:43am
docs Ready Ready Preview, Comment Apr 22, 2026 10:43am
form-filling Ready Ready Preview, Comment Apr 22, 2026 10:43am
research-canvas Ready Ready Preview, Comment Apr 22, 2026 10:43am
travel Ready Ready Preview, Comment Apr 22, 2026 10:43am

Request Review

@changeset-bot

changeset-bot Bot commented Apr 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3aadfb3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@pkg-pr-new

pkg-pr-new Bot commented Apr 12, 2026

Copy link
Copy Markdown

Open in StackBlitz

@copilotkit/a2ui-renderer

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/a2ui-renderer@3840

@copilotkitnext/angular

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkitnext/angular@3840

copilotkit

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/copilotkit@3840

@copilotkit/core

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/core@3840

@copilotkit/react-core

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/react-core@3840

@copilotkit/react-textarea

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/react-textarea@3840

@copilotkit/react-ui

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/react-ui@3840

@copilotkit/runtime

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/runtime@3840

@copilotkit/runtime-client-gql

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/runtime-client-gql@3840

@copilotkit/sdk-js

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/sdk-js@3840

@copilotkit/shared

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/shared@3840

@copilotkit/sqlite-runner

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/sqlite-runner@3840

@copilotkit/voice

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/voice@3840

copilotkit-vscode-extension

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/copilotkit-vscode-extension@3840

@copilotkit/web-inspector

pnpm add https://pkg.pr.new/CopilotKit/CopilotKit/@copilotkit/web-inspector@3840

commit: db38f50

@AlemTuzlak AlemTuzlak 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.

looks good, tests please

)

Covers the three branches added by the fix:
- getLanguageModel() returns a LanguageModel -> wired into BuiltInAgent
- provider + model strings present -> composed as "provider/model"
- neither present (e.g. LangChainAdapter) -> throws CopilotKitMisuseError
  with adapter name in the message, instead of silently producing
  "undefined/undefined" and failing downstream.

Also guards the partial-info case where only one of provider/model is set
to ensure the regression doesn't re-emerge via a half-populated adapter.
@AlemTuzlak AlemTuzlak merged commit 2b88450 into main Apr 22, 2026
35 checks passed
@AlemTuzlak AlemTuzlak deleted the fix/issue-3217 branch April 22, 2026 12:23
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.

🐛 Bug: LangChainAdapter Regression in v1.50.0+ (Unknown provider "undefined")

3 participants