fix: align credential model and message routing - #54
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #54 +/- ##
==========================================
- Coverage 92.03% 91.98% -0.05%
==========================================
Files 20 20
Lines 8131 8175 +44
Branches 1624 1637 +13
==========================================
+ Hits 7483 7520 +37
- Misses 635 642 +7
Partials 13 13
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9a1080aed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
d9a1080 to
cd27f12
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd27f124bf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66368b44e3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cfe52bf3d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| eligibleCredentials.map((credential) => [ | ||
| credential.filename, | ||
| getCredentialSupportedModels(credential.data), |
There was a problem hiding this comment.
Fall back when saved credential models are empty
When an existing credential has not yet persisted supported_models, this now still materializes a per-credential entry with []. The API-test shell reads initialData.credentialModels[filename] ?? initialData.models, so that empty array is treated as authoritative and hides the models discovered by getModelsForCredentials(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 👍 / 👎.
cfe52bf to
48d02e1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48d02e1f8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const supportedModels = getCredentialSupportedModels(record.data); | ||
| return ( | ||
| supportedModels.length === 0 || supportedModels.includes(requestedModel) |
There was a problem hiding this comment.
Fall back when cached model metadata has no match
When every eligible credential has a nonempty but stale supported_models value that omits a newly enabled upstream model, this filter removes all credentials and the proxy returns No valid CodeBuddy credentials found without contacting upstream. Nonempty model metadata is only refreshed manually or when initially absent, so valid explicit-model requests can remain blocked indefinitely after upstream availability changes; if no cached list matches, fall back to the otherwise eligible credentials or refresh the metadata before rejecting the request.
Useful? React with 👍 / 👎.
Summary
Root cause
The upstream content filter rejects the recorded system/developer envelope, while the same message body succeeds as user content. Credential selection also ignored the requested model in several proxy paths.
Validation