fix(model-provider): handle unknown providers by defaulting to openai-compatible - #1823
Merged
Conversation
✅ Deploy Preview for tarko canceled.
|
✅ Deploy Preview for agent-tars-docs canceled.
|
cjraft
force-pushed
the
fix/issue-1822-models-undefined
branch
from
February 27, 2026 05:11
61f36ed to
bac32ba
Compare
…-compatible When users specify a custom provider like 'kimi' that is not in the predefined provider list, the model resolver now correctly defaults to 'openai-compatible' as the base provider instead of returning the unknown provider name directly. This fixes the "Cannot read properties of undefined (reading 'models')" error that occurred when using custom OpenAI-compatible providers. Also updates .secretlintrc.json to allow test placeholder API key values (like 'test-key', 'kimi-api-key') while keeping security checks active for the test directory. Fixes #1822
cjraft
force-pushed
the
fix/issue-1822-models-undefined
branch
from
February 27, 2026 05:13
bac32ba to
aad1c6b
Compare
ulivz
approved these changes
Feb 27, 2026
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.
Summary
kimiopenai-compatibleas the base providerRoot Cause
When using a custom provider like
kimithat is not in the predefined provider list,getActualProvider()returned the original provider name asbaseProvider. However, this provider doesn't exist in themodelsobject from@tarko/llm-client, causingmodels['kimi'].modelsto throw "Cannot read properties of undefined".Solution
Modified
getActualProvider()inmodel-resolver.tsto:'openai-compatible'Test plan
Fixes #1822