Repository navigation
feat(kimi): add kimi-responses preset for the OpenAI Responses wire - #5429
Closed
yuanyuanlove wants to merge 4 commits into
Closed
yuanyuanlove wants to merge 4 commits into
yuanyuanlove wants to merge 4 commits into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
Kimi 订阅端同时提供 Chat Completions 和 OpenAI Responses 两种协议(同一 baseUrl、同一 OAuth 账号、同一模型
kimi-for-coding)。目前 opencodex 只有一个kimi预设,用户想用 Responses wire 必须手改 config 里的adapter字段——既是隐藏操作,也容易踩到 #4726 的工具结果邻接 400。仓库里 Z.AI(zai-responses)和火山引擎(volcengine-plan-responses)已经用"独立 Responses 预设"解决了同类问题,Kimi 缺一个对等的入口。证据(2026-09-21 实测,非文档转述)
POST https://api.kimi.com/coding/v1/responses(OAuth + kimi-for-coding):非流式 200、SSE 流式完整、工具调用往返正确;[Provider] kimi: no requiresAdjacentResponsesToolResults → 400 when hook-injected developer context splits a tool call from its result #4726 场景(function_call 与 result 之间插 developer 消息)由requiresAdjacentResponsesToolResults修复后 200。function_call/function_call_output)全明文,只有reasoning项是encrypted_content——和官方 Responses 语义一致。oauthId: "kimi"的预设直接读取 kimi 账号的 OAuth credential,无需二次登录。改动
entries-core.ts:新增kimi-responses预设(adapter=openai-responses,oauthId: "kimi"复用登录态),模型元数据与 Chat 预设完全一致(kimi-for-coding默认、1M 上下文、low/high/max 档位、image 输入),挂requiresAdjacentResponsesToolResults: true,featured: false避免首页塞两个 Kimi 入口。provider-registry-parity.test.ts:新增预设的 wire / oauthId 复用 / 模型名单 / 上下文窗口 / 档位断言;modelSuffixBracketStrip和 jawcode alias 的派生列表自动纳入新 id。providers.md(EN + zh-cn):Kimi 行补kimi-responses预设说明及两条 wire 的差异(思考加密 vs 明文)。验证
bun x tsc --noEmit干净。bun test tests/providers/provider-registry-parity.test.ts tests/codex-integration/codex-catalog.test.ts tests/providers/model-rename-migration.test.ts:441 pass / 0 fail。bun install --frozen-lockfile && bun run build(497 页,exit 0)。备注
kimi-code(API key 形态)本次未加 Responses 预设,保持与 Z.AI 一致的最小增量。Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
Documentation
kimi-responsesoption and its behavior.