Repository navigation
Description
What version of Kimi Code is running?
kimi, version 1.52.0 — the archived Python Kimi CLI, which is still what the ACP Registry entry kimi distributes to Zed, T3 Code and JetBrains users. That repository is archived (read-only since 2026-11-03) and MoonshotAI/kimi-cli#2661 asks for issues that still apply to be re-filed here. I have not yet reproduced this on Kimi Code CLI 2.4.1; see "Additional information" for why it may or may not apply.
Which open platform/subscription were you using?
Kimi Code subscription, OAuth login via kimi login against auth.kimi.ai (KIMI_CODE_OAUTH_HOST=https://auth.kimi.ai, KIMI_CODE_BASE_URL=https://api.kimi.ai/coding/v1)
Which model were you using?
kimi-code/kimi-for-coding,thinking (also reproduced with kimi-code/k3.1-pro-highspeed,thinking)
What platform is your computer?
Microsoft Windows NT 10.0.26300.0 x64 (Windows 11 Pro). ACP client: T3 Code desktop (nightly 0.1.7), and a minimal stdio JSON-RPC client for the repro below.
What issue are you seeing?
When Kimi runs as an ACP agent (kimi acp) and the root agent delegates work to a subagent through the Agent tool, every subagent tool call that needs approval (Shell, WriteFile, StrReplaceFile, …) is rejected immediately. The ACP client is never asked: no session/request_permission request is sent for any subagent tool call.
Read-only tools do not need approval, so an explore subagent works and a coder subagent cannot write or run anything. The coder subagent's own summary came back as:
Implementation was blocked by tool permissions.
- Read-only inspection of the task worktree succeeded ...
- All Shell commands targeting <worktree> were rejected.
- `WriteFile` for crates/oia-app/src/witness.rs was also rejected
~/.kimi/logs/kimi.log for the same session (0b621ce7-…), one warning per rejected subagent tool call:
2026-11-03 10:10:46.562 | INFO | kimi_cli.soul.agent:load_agent:402 | 0b621ce7-0e15-40ca-91c4-5b8e218ffc4d - Loading agent: ...\kimi_cli\agents\default\coder.yaml
2026-11-03 10:10:55.361 | WARNING | kimi_cli.acp.session:_handle_approval_request:479 | - Tool call not found: tool_iA0hJE6jlBkCAk3Y0fWFrpjA
2026-11-03 10:10:56.344 | WARNING | kimi_cli.acp.session:_handle_approval_request:479 | - Tool call not found: tool_SwQppi4UTZnhAr6wNMDr5NfY
2026-11-03 10:11:21.806 | WARNING | kimi_cli.acp.session:_handle_approval_request:479 | - Tool call not found: tool_FgtdClAqb9zg2R9thAUjTICe
The ACP client's trace for the same window contains no session/request_permission at all. Root-agent tool calls in the same session are approved normally.
Cause (tag 1.52.0, unchanged on main at 9ab1286b8f):
src/kimi_cli/acp/session.py, ACPSession._handle_approval_request (lines 477–481) looks the approval's tool_call_id up in self._turn_state.tool_calls and rejects when it is missing:
state = self._turn_state.tool_calls.get(request.tool_call_id, None)
if state is None:
logger.warning("Tool call not found: {id}", id=request.tool_call_id)
request.resolve("reject")
return_turn_state.tool_calls is only populated by _send_tool_call for the root agent's ToolCall wire messages. Subagent tool calls arrive wrapped in SubagentEvent, which the ACP prompt loop ignores (case SubagentEvent(): pass, line ~202). The unified approval runtime (1.25.0+) still routes the subagent's ApprovalRequest to the root wire, so it reaches _handle_approval_request with a tool_call_id the session has never seen, and is rejected before the client is consulted.
Everything else in the handler already supports forwarding: request.description and request.display are available, and request.source carries agent_id / subagent_type / parent_tool_call_id.
What steps can reproduce the bug?
Reproduced on the ACP Registry build. The same steps should apply to Kimi Code CLI's kimi acp.
- Install Kimi CLI 1.52.0 (the ACP Registry build) and
kimi login. Leavedefault_yolo = false(the default) in~/.kimi/config.toml. - Run
kimi acpfrom an empty directory and speak ACP over stdio. The client must answersession/request_permissionwith anallow_onceoption so root-agent calls are not the thing being rejected. - Send:
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false},"clientInfo":{"name":"repro","version":"0"}}}
{"jsonrpc":"2.0","id":2,"method":"session/new","params":{"cwd":"<that directory>","mcpServers":[]}}
{"jsonrpc":"2.0","id":3,"method":"session/prompt","params":{"sessionId":"<from session/new>","prompt":[{"type":"text","text":"Use the Agent tool with subagent_type \"coder\" to create a file named subagent-wrote-this.txt in the current working directory containing exactly the line: subagent ok. Do not create the file yourself; only the subagent may write it. After the subagent finishes, reply with one line: DONE or FAILED plus the subagent's summary."}]}}-
Observe: the client receives a
tool_callforAgent, thenin_progressupdates, then the root agent reports that the subagent'sWriteFilewas rejected. Nosession/request_permissionarrives.kimi.logshowsTool call not found: tool_…from_handle_approval_request. The file is not created. -
Control: set
default_yolo = truein~/.kimi/config.tomland repeat. The coder subagent writes the file and the turn ends withDONE, which shows the subagent has the tools and only the approval path is broken. (Session9fec58a5-b5b4-47b4-9250-7b92ce2b38f8,Tool Agent completed in 23.6s, zero permission requests.)
Minimal stdio ACP client used for steps 2–4 (Node 20+): node repro.mjs <path-to-kimi> <empty-dir>. The two KIMI_CODE_* variables select the kimi.ai region; drop them for kimi.com accounts.
import { spawn } from "node:child_process";
import * as fs from "node:fs";
const [exe, workDir] = process.argv.slice(2);
fs.mkdirSync(workDir, { recursive: true });
const child = spawn(exe, ["acp"], { cwd: workDir, stdio: ["pipe", "pipe", "pipe"], env: { ...process.env, KIMI_CODE_OAUTH_HOST: "https://auth.kimi.ai", KIMI_CODE_BASE_URL: "https://api.kimi.ai/coding/v1" } });
let buf = "", sessionId, permissionRequests = 0;
const send = (o) => child.stdin.write(JSON.stringify(o) + "\n");
const finish = (why) => { console.log("finish:", why, "permission requests seen:", permissionRequests); try { child.stdin.end(); } catch {} setTimeout(() => { try { child.kill(); } catch {} process.exit(0); }, 15000); };
child.stdout.on("data", (d) => {
buf += d.toString();
let idx;
while ((idx = buf.indexOf("\n")) >= 0) {
const line = buf.slice(0, idx); buf = buf.slice(idx + 1);
if (!line.trim()) continue;
let msg; try { msg = JSON.parse(line); } catch { continue; }
if (msg.id === 1) send({ jsonrpc: "2.0", id: 2, method: "session/new", params: { cwd: workDir, mcpServers: [] } });
else if (msg.id === 2) {
sessionId = msg.result.sessionId; console.log("session", sessionId, "model", msg.result.models?.currentModelId);
send({ jsonrpc: "2.0", id: 3, method: "session/prompt", params: { sessionId, prompt: [{ type: "text", text: "Use the Agent tool with subagent_type \"coder\" to create a file named subagent-wrote-this.txt in the current working directory containing exactly the line: subagent ok. Do not create the file yourself; only the subagent may write it. After the subagent finishes, reply with one line: DONE or FAILED plus the subagent's summary." }] } });
} else if (msg.id === 3) { console.log("prompt result:", JSON.stringify(msg.result ?? msg.error)); finish("prompt finished"); }
else if (msg.method === "session/request_permission") {
permissionRequests++;
const opt = msg.params.options.find((o) => o.kind === "allow_once") ?? msg.params.options[0];
console.log("permission request for", msg.params.toolCall?.title, "-> answering", opt?.optionId);
send({ jsonrpc: "2.0", id: msg.id, result: { outcome: { outcome: "selected", optionId: opt.optionId } } });
} else if (msg.method === "session/update") {
const u = msg.params.update;
if (u.sessionUpdate === "agent_message_chunk" && u.content?.type === "text") process.stdout.write(u.content.text);
else if (u.sessionUpdate === "tool_call") console.log("\n[tool_call]", u.title, u.kind ?? "");
else if (u.sessionUpdate === "tool_call_update" && u.status) console.log("\n[tool_call_update]", u.toolCallId, u.status);
} else if (msg.method && msg.id !== undefined) { console.log("unhandled request", msg.method); send({ jsonrpc: "2.0", id: msg.id, error: { code: -32601, message: "unsupported" } }); }
}
});
child.stderr.on("data", (d) => process.stderr.write("[stderr] " + d));
child.on("exit", (c) => { console.log("\nkimi exited", c); process.exit(0); });
send({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: 1, clientCapabilities: { fs: { readTextFile: false, writeTextFile: false }, terminal: false }, clientInfo: { name: "probe", version: "0" } } });
setTimeout(() => finish("timeout"), 8 * 60 * 1000);What is the expected behavior?
A subagent's approval request is forwarded to the ACP client like a root-agent one, as a session/request_permission carrying a ToolCallUpdate for the subagent's tool call (or, until subagent tool calls are surfaced over ACP, a synthesized one built from request.description / request.display, with request.source in _meta). The client's answer should resolve the subagent's request. Rejecting without asking should only happen when the client actually rejects.
Additional information
- Impact: every ACP client gets this, since the ACP Registry's
kimientry pins kimi-cli 1.52.0 (https://github.com/MoonshotAI/kimi-cli/releases/download/1.52.0/…). Registry issue Add kimi-code to registry (successor to kimi-cli) agentclientprotocol/registry#469 and PR feat(env): migrate kimi-cli model request params and auto-update toggle #458 propose adding Kimi Code CLI as the successor entry. - Workaround for users:
default_yolo = truein~/.kimi/config.toml.kimi acpcreates sessions withKimiCLI.create(session, mcp_configs=…, ui_mode="acp")and noyoloargument, so the config default applies (app.pyline 237). This bypasses the client's approval gate for all of Kimi's native tools, so it is a trade-off, not a fix. - Why file here: the archived repository refuses new issues, and 📢 Kimi CLI is no longer maintained: please migrate to Kimi Code CLI | Kimi CLI 停止维护,请迁移至 Kimi Code CLI kimi-cli#2661 asks for still-applicable issues to be re-filed in this repository. Kimi Code CLI 2.4.1's ACP server (
packages/acp-server/src/approval.ts,buildPermissionToolCallUpdate) builds the permissionToolCallUpdatedirectly from the request and does not do the tool-call lookup that breaks 1.52.0, so the symptom may already be gone here. What I could not verify from the source alone is whether a subagent's approval request reaches the interaction bridge at all, given the main-agent guard described in ACP: subagent work is invisible — forward subagent lifecycle and streams over session updates #2482. If 2.4.1 forwards subagent approvals over ACP, a one-line confirmation here would be enough, and the remaining fix is on the registry side. - Until the registry entry moves (Add kimi-code to registry (successor to kimi-cli) agentclientprotocol/registry#469, PR feat(env): migrate kimi-cli model request params and auto-update toggle #458), every ACP Registry user gets 1.52.0 with this bug. A Kimi Code CLI entry in the registry would close it for them.
- Noticed while using Kimi through T3 Code; the root agent's own calls are approved there in a few milliseconds, which is how the subagent-only rejection stood out.
Contribution
- I am willing to submit a PR for this bug fix myself (please wait for maintainer approval in this issue first)
Activity
MoonshotAI-support commentedon Nov 4, 2026
Hi, this has been escalated to the development team, thanks for your valuable feedback.
MoonshotAI-support commentedon Nov 10, 2026
Hi, follow up on the issue, the issue has been resolved in the current version (v2.5.2) based on testing