MoonshotAI / MoonshotAI/kimi-code
[Bug] [tools].disabled is ignored by the default terminal CLI
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
What version of Kimi Code is running?
0.31.1
Which open platform/subscription were you using?
N/A — custom OpenAI-compatible provider (not using /login)
Which model were you using?
Custom OpenAI Responses model
What platform is your computer?
Darwin 27.0.0 arm64 arm
What issue are you seeing?
[tools].disabled is ignored on the default CLI path (v1) in Kimi Code 0.31.1.
With this config:
[tools]
disabled = ["Bash"]
the matching llm.tools_snapshot still includes the top-level Bash tool. The model-facing Agent tool description also still lists Bash for subagent profiles. kimi doctor reports that the config is valid.
With the same config and KIMI_CODE_EXPERIMENTAL_FLAG=1, the v2 engine removes Bash from both the top-level tool list and the subagent Tools: lines.
The original symptom involved disabled = ["WebSearch"], but logout can independently prevent WebSearch from being registered. The Bash case above avoids that provider-related ambiguity and reproduces the policy problem in both the top-level tool list and the Agent description.
What steps can reproduce the bug?
-
Add this to
config.tomlbefore starting Kimi Code:[tools] disabled = ["Bash"] -
Confirm the file is accepted:
kimi doctor -
Make sure
KIMI_CODE_EXPERIMENTAL_FLAGis unset, then start a fresh CLI process:kimi -p 'Reply exactly OK. Do not call tools.' -
In that session's
wire.jsonl, take the final loopllm.request.toolsHashand inspect thellm.tools_snapshotwith the matchinghash. -
Observe that
.tools[].namestill containsBash, and theAgenttool description still includesBashin its subagentTools:lines. -
Run the same command as a v2 control:
KIMI_CODE_EXPERIMENTAL_FLAG=1 kimi -p 'Reply exactly OK. Do not call tools.'
Observed on 0.31.1:
default v1: Bash in top-level tools = yes; Bash in Agent description = yes
v2 control: Bash in top-level tools = no; Bash in Agent description = no
What is the expected behavior?
[tools].disabled should work on the default CLI path as documented. A disabled built-in tool should not be sent to the model or listed in model-facing subagent descriptions. This should not require opting into the experimental v2 engine.
Additional information
The source appears to match the observed engine split:
apps/kimi-code/src/cli/experimental-v2.tskeeps the CLI on v1 unlessKIMI_CODE_EXPERIMENTAL_FLAGis truthy.packages/agent-core-v2/src/agent/toolPolicy/implements the global[tools]policy, and the v2 control applies it correctly.- I could not find equivalent global
[tools]policy integration inpackages/agent-core. Itspackages/agent-core/src/tools/builtin/collaboration/agent.tsbuilds the v1 subagent description from profiletools/disallowedTools.
The documentation says the global tools switch applies to every agent in all sessions and shapes the tools shown to the model: docs/en/configuration/config-files.md (tools section).
Related but not a duplicate: #2421 concerns MCP tools merged into the request after filtering. This report concerns built-in tools on the default v1 CLI path; the v2 control behaves correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/kimi-code/src/cli/experimental-v2.ts and compare the v1 path with packages/agent-core-v2/src/agent/toolPolicy/ and packages/agent-core/src/tools/builtin/collaboration/agent.ts. Reproduce with kimi doctor and the two kimi -p commands, then verify in wire.jsonl that disabled built-in tools are absent from the top-level snapshot and model-facing Agent descriptions on the default path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100