feat(ai): add Qoder CLI provider

This commit is contained in:
lewis authored and GitHub committed 2026-08-11 21:33:15 +08:00
1 parent da6e2738ce
commit c72b429899
38 files changed
+1100 -19

No files matched your search

@@ -24,7 +24,7 @@ describe("isAiConfigModelCandidate", () => {
expect(isAiConfigModelCandidate(config({ apiKey: "" }), true)).toBe(false);
});
it.each(["codex-cli", "claude-code-cli", "opencode-cli", "pi-agent-cli", "cursor-cli", "grok-cli", "codebuddy-cli"] as const)("keeps %s configs eligible without endpoint, API key, or model metadata", (provider) => {
it.each(["codex-cli", "claude-code-cli", "opencode-cli", "pi-agent-cli", "cursor-cli", "grok-cli", "codebuddy-cli", "qoder-cli"] as const)("keeps %s configs eligible without endpoint, API key, or model metadata", (provider) => {
expect(
isAiConfigModelCandidate(
config({
@@ -38,4 +38,19 @@ describe("isAiConfigModelCandidate", () => {
),
).toBe(true);
});
it.each(["codex-cli", "claude-code-cli", "opencode-cli", "pi-agent-cli", "cursor-cli", "grok-cli", "codebuddy-cli", "qoder-cli"] as const)("filters existing %s configs when local CLI providers are unavailable", (provider) => {
expect(
isAiConfigModelCandidate(
config({
provider,
endpoint: "",
apiKey: "",
model: "default",
}),
false,
false,
),
).toBe(false);
});
});
+2 -1
View File
@@ -24,12 +24,13 @@ describe("orderAiConfigsForDisplay", () => {
{ id: "opencode", provider: "opencode-cli" },
{ id: "cursor", provider: "cursor-cli" },
{ id: "codebuddy", provider: "codebuddy-cli" },
{ id: "qoder", provider: "qoder-cli" },
{ id: "grok", provider: "grok-cli" },
{ id: "pi", provider: "pi-agent-cli" },
{ id: "custom", provider: "custom" },
];
expect(orderAiConfigsForDisplay(configs).map((config) => config.id)).toEqual(["claude", "openai", "gemini", "deepseek", "qwen", "minimax", "ollama", "anthropic-compatible", "openai-compatible", "claude-code-1", "codex", "opencode", "cursor", "codebuddy", "grok", "pi", "custom"]);
expect(orderAiConfigsForDisplay(configs).map((config) => config.id)).toEqual(["claude", "openai", "gemini", "deepseek", "qwen", "minimax", "ollama", "anthropic-compatible", "openai-compatible", "claude-code-1", "codex", "opencode", "cursor", "codebuddy", "qoder", "grok", "pi", "custom"]);
});
it("preserves creation order for configs from the same provider", () => {
@@ -1,9 +1,9 @@
import type { AiConfig } from "@/types/ai";
const CLI_PROVIDERS = new Set<AiConfig["provider"]>(["codex-cli", "claude-code-cli", "opencode-cli", "pi-agent-cli", "cursor-cli", "grok-cli", "codebuddy-cli"]);
const CLI_PROVIDERS = new Set<AiConfig["provider"]>(["codex-cli", "claude-code-cli", "opencode-cli", "pi-agent-cli", "cursor-cli", "grok-cli", "codebuddy-cli", "qoder-cli"]);
export function isAiConfigModelCandidate(config: AiConfig, requiresApiKey: boolean): boolean {
export function isAiConfigModelCandidate(config: AiConfig, requiresApiKey: boolean, supportsCliProviders = true): boolean {
// CLI providers resolve their model and credentials externally, so keep the existing eligibility bypass.
if (CLI_PROVIDERS.has(config.provider)) return true;
if (CLI_PROVIDERS.has(config.provider)) return supportsCliProviders;
return !!config.endpoint?.trim() && (!requiresApiKey || !!config.apiKey?.trim());
}