What version of Kimi Code CLI is running?
0.39.1 (homebrew, /opt/homebrew/bin/kimi)
Which open platform/subscription were you using?
Kimi Code subscription (managed kimi-code provider, OAuth login via api.kimi.com)
Which model were you using?
kimi-code/k3-256k (shown as K3-256k, thinking effort high)
What platform is your computer?
Darwin 25.5.0 arm64 arm (macOS, Apple Silicon)
What issue are you seeing?
In one session, every attempt to call the Write or Edit tool arrived at the tool layer as a Read call with the same path argument — 5/5 Write attempts and 1/1 Edit attempt. The file was never created/modified. The assistant's own text in the very same message said it was calling Write/Edit.
I first suspected the harness was downgrading/remapping the calls (read-only mode, permission deny). The session wire file (wire.jsonl) proves that is NOT the case — the model itself emitted Read as the tool name, and the CLI faithfully executed what it received:
- Permission mode is
yolo — no read-only/plan restriction:
{"type":"permission.set_mode","agentId":"main","mode":"yolo"}
- The tools payload sent to the API (201 tools,
llm.tools_snapshot) does contain the Write and Edit definitions — the model had them available.
- Counting actual tool calls in the wire:
"name": "Write" appears 0 times, "name": "Edit" 0 times. All write attempts are recorded as e.g.:
CALL: Read | {'path': '/tmp/kimi-tool-test/hello.txt'}
CALL: Read | {'path': '/tmp/kimi-tool-test/write-test.txt'}
CALL: Read | {'path': '/tmp/kimi-tool-test/edit-test.txt'}
i.e. the arguments were generated correctly for a write (right path), but the tool-name token came out Read.
- The assistant message pairs contradictory text and tool call, e.g. text
现在实际调用 Write。 ("now actually calling Write") immediately followed by a Read tool call on that path.
- A control
Bash file write (printf > file) in the same session worked fine, so disk/permissions are not the issue.
What steps can reproduce the bug?
- Start a session on model
kimi-code/k3-256k.
- Ask: "试一下edit和write能不能正常调用" (test whether Edit and Write work).
- The agent attempts
Write to a new path → executes as Read → "file does not exist" → retry loop, never actually writing.
Session id: session_82ba1b98-f6a8-4b16-8e5a-e8fc5f52e539 (workspace claudecode-workspace, 2026-08-30 15:24 UTC).
Reproducibility unknown — likely intermittent/model-side. I have not yet retried in a fresh session.
What is the expected behavior?
When the model decides to call Write/Edit (its own reasoning text says so), the emitted tool call should carry the matching tool name, so the file actually gets written.
Additional information
What version of Kimi Code CLI is running?
0.39.1 (homebrew,
/opt/homebrew/bin/kimi)Which open platform/subscription were you using?
Kimi Code subscription (managed
kimi-codeprovider, OAuth login via api.kimi.com)Which model were you using?
kimi-code/k3-256k(shown as K3-256k, thinking effort high)What platform is your computer?
Darwin 25.5.0 arm64 arm (macOS, Apple Silicon)
What issue are you seeing?
In one session, every attempt to call the
WriteorEdittool arrived at the tool layer as aReadcall with the samepathargument — 5/5Writeattempts and 1/1Editattempt. The file was never created/modified. The assistant's own text in the very same message said it was callingWrite/Edit.I first suspected the harness was downgrading/remapping the calls (read-only mode, permission deny). The session wire file (
wire.jsonl) proves that is NOT the case — the model itself emittedReadas the tool name, and the CLI faithfully executed what it received:yolo— no read-only/plan restriction:{"type":"permission.set_mode","agentId":"main","mode":"yolo"}llm.tools_snapshot) does contain theWriteandEditdefinitions — the model had them available."name": "Write"appears 0 times,"name": "Edit"0 times. All write attempts are recorded as e.g.:Read.现在实际调用 Write。("now actually calling Write") immediately followed by aReadtool call on that path.Bashfile write (printf > file) in the same session worked fine, so disk/permissions are not the issue.What steps can reproduce the bug?
kimi-code/k3-256k.Writeto a new path → executes asRead→ "file does not exist" → retry loop, never actually writing.Session id:
session_82ba1b98-f6a8-4b16-8e5a-e8fc5f52e539(workspaceclaudecode-workspace, 2026-08-30 15:24 UTC).Reproducibility unknown — likely intermittent/model-side. I have not yet retried in a fresh session.
What is the expected behavior?
When the model decides to call
Write/Edit(its own reasoning text says so), the emitted tool call should carry the matching tool name, so the file actually gets written.Additional information
Read— which may help isolate whether the root cause is model-side tool-name emission vs. tool execution.wire.jsonl(909 KB) and session log privately on request; it contains the complete evidence chain (permission mode, tools snapshot, all emitted tool calls, and the assistant text/call mismatches).