fix: add openai-codex to providers that don't require API key (#10786)

Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2026-01-16 17:13:50 -05:00 committed by GitHub
parent 9533f0be3c
commit c40c882561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 40 additions and 2 deletions

View file

@ -59,4 +59,39 @@ describe("checkExistKey", () => {
}
expect(checkExistKey(config)).toBe(false)
})
it("should return true for fake-ai provider without API key", () => {
const config: ProviderSettings = {
apiProvider: "fake-ai",
}
expect(checkExistKey(config)).toBe(true)
})
it("should return true for claude-code provider without API key", () => {
const config: ProviderSettings = {
apiProvider: "claude-code",
}
expect(checkExistKey(config)).toBe(true)
})
it("should return true for openai-codex provider without API key", () => {
const config: ProviderSettings = {
apiProvider: "openai-codex",
}
expect(checkExistKey(config)).toBe(true)
})
it("should return true for qwen-code provider without API key", () => {
const config: ProviderSettings = {
apiProvider: "qwen-code",
}
expect(checkExistKey(config)).toBe(true)
})
it("should return true for roo provider without API key", () => {
const config: ProviderSettings = {
apiProvider: "roo",
}
expect(checkExistKey(config)).toBe(true)
})
})

View file

@ -5,8 +5,11 @@ export function checkExistKey(config: ProviderSettings | undefined) {
return false
}
// Special case for fake-ai, claude-code, qwen-code, and roo providers which don't need any configuration.
if (config.apiProvider && ["fake-ai", "claude-code", "qwen-code", "roo"].includes(config.apiProvider)) {
// Special case for fake-ai, claude-code, openai-codex, qwen-code, and roo providers which don't need any configuration.
if (
config.apiProvider &&
["fake-ai", "claude-code", "openai-codex", "qwen-code", "roo"].includes(config.apiProvider)
) {
return true
}