Skip to content
Closed
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
7 changes: 7 additions & 0 deletions .changeset/zai-provider-fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@kilocode/cli": patch
---

Fixes z.ai provider setup failure by collecting all required configuration fields. The authentication wizard now prompts for API line selection (international_coding or china_coding) and sets the default model to gpt-4o.

Fixes #3828
26 changes: 24 additions & 2 deletions cli/src/utils/authWizard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import openConfigFile from "../config/openConfig"
import wait from "../utils/wait"
import { getKilocodeDefaultModel } from "./getKilocodeDefaultModel.js"
import { getKilocodeProfile, INVALID_TOKEN_ERROR, type KilocodeProfileData } from "./getKilocodeProfile.js"
import { getProviderDefaultModel } from "../constants/providers/settings.js"

export default async function authWizard() {
const config = await loadConfig()
Expand Down Expand Up @@ -103,14 +104,35 @@ export default async function authWizard() {
break
}
case "zai": {
const { zaiApiKey } = await inquirer.prompt<{ zaiApiKey: string }>([
const { zaiApiKey, zaiApiLine } = await inquirer.prompt<{
zaiApiKey: string
zaiApiLine: "international_coding" | "china_coding"
}>([
{
type: "password",
name: "zaiApiKey",
message: "Please enter your zAI token:",
},
{
type: "list",
name: "zaiApiLine",
message: "Select your zAI API line:",
choices: [
{ name: "International Coding", value: "international_coding" },
{ name: "China Coding", value: "china_coding" },
],
default: "international_coding",
},
])
providerSpecificConfig = { zaiApiKey }

// Get the default model for zai provider
const defaultModel = getProviderDefaultModel("zai")

providerSpecificConfig = {
zaiApiKey,
zaiApiLine,
apiModelId: defaultModel,
}
break
}
case "other": {
Expand Down