fix: prefer env keys unless profiles configured

This commit is contained in:
Peter Steinberger
2026-01-06 01:21:45 +00:00
parent 216a23ed08
commit 085c70a87b
3 changed files with 63 additions and 5 deletions

View File

@@ -40,7 +40,19 @@ describe("getApiKeyForModel", () => {
api: "openai-codex-responses",
} as Model<Api>;
const apiKey = await getApiKeyForModel({ model });
const apiKey = await getApiKeyForModel({
model,
cfg: {
auth: {
profiles: {
"openai-codex:default": {
provider: "openai-codex",
mode: "oauth",
},
},
},
},
});
expect(apiKey.apiKey).toBe(oauthFixture.access);
const authProfiles = await fs.readFile(