fix(ai): set default Kimi Coding user agent closes #3586
This commit is contained in:
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed built-in `kimi-coding` model generation to attach `User-Agent: KimiCLI/1.5` to all generated Kimi models, overriding the Anthropic SDK default UA so direct Kimi Coding requests use the provider's expected client identity ([#3586](https://github.com/badlogic/pi-mono/issues/3586))
|
||||||
|
|
||||||
## [0.69.0] - 2026-04-22
|
## [0.69.0] - 2026-04-22
|
||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|||||||
@@ -53,6 +53,10 @@ const COPILOT_STATIC_HEADERS = {
|
|||||||
"Copilot-Integration-Id": "vscode-chat",
|
"Copilot-Integration-Id": "vscode-chat",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
|
const KIMI_STATIC_HEADERS = {
|
||||||
|
"User-Agent": "KimiCLI/1.5",
|
||||||
|
} as const;
|
||||||
|
|
||||||
const AI_GATEWAY_MODELS_URL = "https://ai-gateway.vercel.sh/v1";
|
const AI_GATEWAY_MODELS_URL = "https://ai-gateway.vercel.sh/v1";
|
||||||
const AI_GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh";
|
const AI_GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh";
|
||||||
const ZAI_TOOL_STREAM_UNSUPPORTED_MODELS = new Set(["glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v"]);
|
const ZAI_TOOL_STREAM_UNSUPPORTED_MODELS = new Set(["glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v"]);
|
||||||
@@ -665,6 +669,7 @@ async function loadModelsDevData(): Promise<Model<any>[]> {
|
|||||||
provider: "kimi-coding",
|
provider: "kimi-coding",
|
||||||
// Kimi For Coding's Anthropic-compatible API - SDK appends /v1/messages
|
// Kimi For Coding's Anthropic-compatible API - SDK appends /v1/messages
|
||||||
baseUrl: "https://api.kimi.com/coding",
|
baseUrl: "https://api.kimi.com/coding",
|
||||||
|
headers: { ...KIMI_STATIC_HEADERS },
|
||||||
reasoning: m.reasoning === true,
|
reasoning: m.reasoning === true,
|
||||||
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
|
input: m.modalities?.input?.includes("image") ? ["text", "image"] : ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
|
|||||||
@@ -5120,6 +5120,7 @@ export const MODELS = {
|
|||||||
api: "anthropic-messages",
|
api: "anthropic-messages",
|
||||||
provider: "kimi-coding",
|
provider: "kimi-coding",
|
||||||
baseUrl: "https://api.kimi.com/coding",
|
baseUrl: "https://api.kimi.com/coding",
|
||||||
|
headers: {"User-Agent":"KimiCLI/1.5"},
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -5137,6 +5138,7 @@ export const MODELS = {
|
|||||||
api: "anthropic-messages",
|
api: "anthropic-messages",
|
||||||
provider: "kimi-coding",
|
provider: "kimi-coding",
|
||||||
baseUrl: "https://api.kimi.com/coding",
|
baseUrl: "https://api.kimi.com/coding",
|
||||||
|
headers: {"User-Agent":"KimiCLI/1.5"},
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text", "image"],
|
input: ["text", "image"],
|
||||||
cost: {
|
cost: {
|
||||||
@@ -5154,6 +5156,7 @@ export const MODELS = {
|
|||||||
api: "anthropic-messages",
|
api: "anthropic-messages",
|
||||||
provider: "kimi-coding",
|
provider: "kimi-coding",
|
||||||
baseUrl: "https://api.kimi.com/coding",
|
baseUrl: "https://api.kimi.com/coding",
|
||||||
|
headers: {"User-Agent":"KimiCLI/1.5"},
|
||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
|
|||||||
Reference in New Issue
Block a user