Repository navigation
fix(core,vscode): keep provider update versions in sync #8889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
1df9c1d
71bd8f1
244451c
ffa5c8d
d798388
bbd4889
2469ebc
a447db5
4099542
3646f92
92ca1f4
bec8736
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,8 +62,14 @@ describe('buildInstallPlan', () => { | |
| }); | ||
|
|
||
| it('builds a plan with editable models and unknown IDs', () => { | ||
| const config = makeConfig({ modelsEditable: true }); | ||
| const plan = buildInstallPlan(config, { | ||
| const config = makeConfig({ | ||
| modelsEditable: true, | ||
| models: [ | ||
| { id: 'model-a', contextWindowSize: 8192, enableThinking: true }, | ||
| { id: 'model-b' }, | ||
| ], | ||
| }); | ||
| const plan = buildInstallPlanSrc(config, { | ||
| baseUrl: 'https://api.test.com/v1', | ||
| apiKey: 'sk-test', | ||
| modelIds: ['model-a', 'unknown-model'], | ||
|
|
@@ -77,6 +83,9 @@ describe('buildInstallPlan', () => { | |
| name: '[Test] unknown-model', | ||
| }); | ||
| expect(models?.[1]?.generationConfig).toBeUndefined(); | ||
| expect(plan.providerState?.['providerMetadata.test']?.['version']).toBe( | ||
| computeModelListVersion(models ?? []), | ||
| ); | ||
| }); | ||
|
|
||
| it('applies advancedConfig to editable unknown model IDs only', () => { | ||
|
|
@@ -674,7 +683,9 @@ import { | |
| getAllProviderBaseUrls as getAllProviderBaseUrlsSrc, | ||
| } from '../all-providers.js'; | ||
| import { | ||
| buildInstallPlan as buildInstallPlanSrc, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Minor] Still unresolved from the previous review: source import placed after first use
Please move this source-relative import block (and the This review was generated by QoderWork AI |
||
| resolveBaseUrl as resolveBaseUrlSrc, | ||
| resolveMetadataKey as resolveMetadataKeySrc, | ||
| providerMatchesCredentials as providerMatchesCredentialsSrc, | ||
| } from '../provider-config.js'; | ||
|
|
||
|
|
@@ -795,8 +806,6 @@ describe('providerMatchesCredentials with function envKey (custom provider)', () | |
| }); | ||
| }); | ||
|
|
||
| import { resolveMetadataKey as resolveMetadataKeySrc } from '../provider-config.js'; | ||
|
|
||
| describe('customHeaders in ProviderConfig', () => { | ||
| it('merges customHeaders into generationConfig for fixed models', () => { | ||
| const config = makeConfig({ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Minor] The prompt still promises a model switch this line prevents
Deleting
modelSelectionmakesapplyProviderInstallPlanskip the model-selection block (core/src/providers/install.ts:236-271) and never callsyncAuthState(install.ts:288-295) — which92ca1f4fnow correctly asserts.However
packages/cli/src/ui/components/ProviderUpdatePrompt.tsx:99-102still shows, before the user confirms:using
diff.fallbackModel(newModelIds[0], computed at line 151 of this file). After this change that never happens:model.nameis never rewritten, so settings keep pointing at the removed model.refreshAuthruns, and the model it re-resolves is not guaranteed to befallbackModel.refreshAuthis not called at all, so the stale selection survives to the next launch.Either soften the prompt text (e.g. "Your selected model is being removed; use
/modelto pick a new one") or restore an explicit switch limited to thecurrentModelAffectedcase.Note: the
Model switched to "{{model}}"branch below (lines 325-336) is still reachable viarefreshAuthre-resolution (seeconfig.ts:3686-3687), so it should not be removed. But thesyncAuthStatecallback at lines 303-306 is now unreachable on this path.This review was generated by QoderWork AI