Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/shared/__tests__/checkExistApiConfig.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
7 changes: 5 additions & 2 deletions src/shared/checkExistApiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Loading