← Back to PRs

#15197: fix: allow OpenAI auth profiles for OpenAI-compatible providers

by bufordtjustice2918 open 2026-02-13 04:42 View on GitHub →
agents stale size: XS
Fixes #15096. OpenAI-compatible providers (openai-completions/responses) now accept OpenAI auth profiles when provider-specific profiles are absent. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This change updates `resolveAuthProfileOrder` to treat providers configured with `api: "openai-completions"` or `api: "openai-responses"` as OpenAI-compatible, allowing them to use `openai` auth profiles when provider-specific profiles are not present. The logic is implemented by expanding the provider match filter (`allowedProviderKeys`) and adding a fallback to `listProfilesForProvider(store, "openai")` when an OpenAI-compatible provider has no profiles/order entries of its own. This affects how provider auth selection works anywhere `resolveAuthProfileOrder` is used (e.g., resolving API keys for provider requests). <h3>Confidence Score: 4/5</h3> - This PR looks safe to merge; it’s a targeted change with straightforward control-flow updates. - Reviewed the only modified file end-to-end and traced key helpers (`normalizeProviderId`, `listProfilesForProvider`) and the main caller (`resolveApiKeyForProvider`). The new allowlist/fallback behavior appears consistent with the PR intent and doesn’t introduce obvious runtime errors. Main remaining risk is behavior change without dedicated regression tests for the new OpenAI-compatible path. - src/agents/auth-profiles/order.ts <sub>Last reviewed commit: 6ac2be0</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs