From a30c8df0bca0d6086d7b788122a73e61f9c5a5ec Mon Sep 17 00:00:00 2001 From: Roo Code Date: Fri, 16 Jan 2026 21:41:11 +0000 Subject: [PATCH] fix: add openai-codex to providers that don't require API key --- .../__tests__/checkExistApiConfig.spec.ts | 35 +++++++++++++++++++ src/shared/checkExistApiConfig.ts | 7 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/shared/__tests__/checkExistApiConfig.spec.ts b/src/shared/__tests__/checkExistApiConfig.spec.ts index 58ea3bccbbd..826cc792257 100644 --- a/src/shared/__tests__/checkExistApiConfig.spec.ts +++ b/src/shared/__tests__/checkExistApiConfig.spec.ts @@ -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) + }) }) diff --git a/src/shared/checkExistApiConfig.ts b/src/shared/checkExistApiConfig.ts index 37b468ce1ac..37b37ea7a36 100644 --- a/src/shared/checkExistApiConfig.ts +++ b/src/shared/checkExistApiConfig.ts @@ -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 }