-
Notifications
You must be signed in to change notification settings - Fork 1
fix: align credential model and message routing #54
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 all commits
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 |
|---|---|---|
|
|
@@ -690,16 +690,26 @@ export const resolveCredentialForRequest = async ({ | |
| accessKeyId, | ||
| affinityKey, | ||
| allowedCredentialFilenames, | ||
| model, | ||
| }: { | ||
| accessKeyId?: string; | ||
| affinityKey?: string; | ||
| allowedCredentialFilenames?: string[]; | ||
| model?: string; | ||
| } = {}): Promise<CredentialRecord | null> => { | ||
| const records = await readCredentialRecords(); | ||
| const requestedModel = model?.trim(); | ||
| const eligibleRecords = getEligibleRecords( | ||
| records, | ||
| allowedCredentialFilenames, | ||
| ); | ||
| ).filter((record) => { | ||
| if (!requestedModel) return true; | ||
|
|
||
| const supportedModels = getCredentialSupportedModels(record.data); | ||
| return ( | ||
| supportedModels.length === 0 || supportedModels.includes(requestedModel) | ||
|
Comment on lines
+708
to
+710
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.
When every eligible credential has a nonempty but stale Useful? React with 👍 / 👎. |
||
| ); | ||
| }); | ||
|
|
||
| if (!eligibleRecords.length) { | ||
| return null; | ||
|
|
||
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.
When an existing credential has not yet persisted
supported_models, this now still materializes a per-credential entry with[]. The API-test shell readsinitialData.credentialModels[filename] ?? initialData.models, so that empty array is treated as authoritative and hides the models discovered bygetModelsForCredentials(eligibleCredentials)on the same load; legacy credentials or credentials whose startup refresh has not completed can therefore show an empty model selector even though discovery succeeded. Omit empty entries or populate them from per-credential discovery so the global fallback remains usable.Useful? React with 👍 / 👎.