Conversation
Greptile SummaryThis PR fixes model fetching for Codex channels that use
Confidence Score: 4/5The change is targeted and low-risk — it adds a fallback for Codex/Claudecode to return a static hardcoded model list and adjusts how the frontend forwards OAuth JSON blobs, with no changes to authentication paths. Both changes are narrow and logically consistent with the existing design. The slight mismatch between the frontend JSON detection heuristic and the backend stricter check is the main gap — a malformed JSON blob could reach the provider API as a bearer token and silently fail rather than falling back to defaults. frontend/src/features/channels/components/channels-action-dialog.tsx — the JSON detection heuristic on line 1158 is slightly looser than its backend counterpart. Important Files Changed
Reviews (1): Last reviewed commit: "fix: fetch models for codex with auth.js..." | Re-trigger Greptile |
| // If it's OAuth JSON, send full JSON so backend detects isOAuthJSON | ||
| if (oauthApiKey.trimStart().startsWith('{')) { | ||
| firstApiKey = oauthApiKey; | ||
| } else { |
There was a problem hiding this comment.
The frontend detection heuristic (
trimStart().startsWith('{')) is looser than the backend's isOAuthJSON, which additionally requires access_token to be present. For a credential that starts with { but lacks access_token (e.g. a partial or malformed JSON), the frontend will forward the raw JSON blob, isOAuthJSON will return false, and the backend will proceed to use the JSON string as a Bearer token value — resulting in a silent auth failure instead of the expected default-model response. Aligning the client-side check to also require access_token keeps both sides consistent.
| // If it's OAuth JSON, send full JSON so backend detects isOAuthJSON | |
| if (oauthApiKey.trimStart().startsWith('{')) { | |
| firstApiKey = oauthApiKey; | |
| } else { | |
| // If it's OAuth JSON (contains access_token), send full JSON so backend detects isOAuthJSON | |
| if (oauthApiKey.trimStart().startsWith('{') && oauthApiKey.includes('access_token')) { | |
| firstApiKey = oauthApiKey; | |
| } else { |
There was a problem hiding this comment.
Code Review
This pull request updates the frontend to send the full OAuth JSON string to the backend when detected, ensuring proper identification of OAuth-based providers. Additionally, the backend's model fetcher now retrieves default models for official-only channel types when an API key is not provided, rather than returning an error. I have no feedback to provide as there were no review comments.
No description provided.