MoonshotAI / MoonshotAI/kimi-code
[Bug] Interactive TUI and non-interactive -p mode both hang indefinitely on kimi-k3 (max effort); Ctrl+C/Esc unresponsive for 10+ min; agent also exceeds instructed scope
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.27.0
Which open platform/subscription were you using?
Kimi Platform (API key · platform.kimi.com)
Which model were you using?
moonshot-cn/kimi-k3 (max_context_size 1048576, support_efforts=["max"] only, default_effort="max")
What platform is your computer?
Darwin 25.5.0 arm64 arm
What issue are you seeing?
Kimi Code CLI hangs with no visible output for 10+ minutes in both interactive mode and non-interactive -p mode, even though the underlying Moonshot API itself responds in seconds when called directly via curl with the same key and endpoint.
This happened on two separate occasions in the same project:
kimi -p "hi" -m moonshot-cn/kimi-k3— a trivial single-word prompt hung for 2+ minutes with no output, Ctrl+C had no effect, had to force-quit the terminal entirely.- In interactive mode, after asking for a scoped code review ("only write a report, don't modify code"), the agent silently ran a long unauthorized chain of Bash commands (git diff against an unrelated legacy directory, npx vitest run, etc.) with zero visible progress for 10+ minutes. Ctrl+C and Esc were unresponsive until the chain finished on its own.
Key findings that rule out other causes:
- curl to the same API endpoint/key returns in seconds → not a network/auth/balance issue
ps auxshows the kimi process CPU at 10%+ and growing → not a dead/frozen process- Context usage was only 4% (30.7k/1M) → not a context overflow issue
kimi doctorreports config valid, CLI is already on latest version (0.27.0)
This suggests the issue is not purely "task too large", since a one-word prompt exhibited the same symptom.
What steps can reproduce the bug?
Setup:
- CLI version: 0.27.0
- Model: moonshot-cn/kimi-k3 (max_context_size 1048576, effort forced to "max", no lower option available)
- Provider: moonshot-cn, https://api.moonshot.cn/v1
- Project: mid-size React + TypeScript codebase (~1.4MB)
Repro A (trivial prompt hangs):
- Run
kimi -p "hi" -m moonshot-cn/kimi-k3 - No output for 2+ minutes
- Ctrl+C has no effect; requires force-quitting the terminal app
Repro B (interactive mode, scope creep + silent long chain):
- Start
kimiin project root with an existing session - Send a request scoped to reviewing two specific UI sections, explicitly stating "only write a report, don't modify code"
- Agent begins a long, mostly-silent Bash tool-call sequence:
- git log --oneline -8 -- legacy-backup/
- ls -la src/components/ src/pages/ ...
- diff legacy-backup/src/lib/moduleA.ts ...
- npx vitest run src/lib/tests/moduleA...
(legacy-backup/ is an unrelated archived directory never mentioned in the instruction; running vitest was never requested)
- No new TUI output for 10+ minutes
- Ctrl+C / Esc unresponsive during this window
- Eventually Ctrl+C succeeds, showing "Interrupted by user"
Verification that the API itself is healthy:
curl -s https://api.moonshot.cn/v1/chat/completions
-H "Content-Type: application/json"
-H "Authorization: Bearer $API_KEY"
-d '{"model":"kimi-k3","messages":[{"role":"user","content":"hi"}]}'
→ returns in seconds with a valid response
What is the expected behavior?
- A trivial prompt like "hi" should return in seconds, matching the latency of a direct API call
- During long tool-call chains, the TUI should show real-time progress instead of going silent
- Ctrl+C / Esc should interrupt immediately, not queue for 10+ minutes
- The agent should respect explicit scope instructions and not autonomously diff unrelated legacy directories or run test suites that weren't requested
Additional information
Suggested fixes:
- Add per-command progress indicators during multi-step Bash tool chains (e.g. "Running step N:
command") - Make Ctrl+C/Esc interrupt immediately, even mid-command
- Improve scope adherence when the user explicitly says "don't run tests" / "don't touch other directories"
- Expose lower
effortlevels for kimi-k3 (currently only "max" is available via support_efforts), so users can trade speed for depth - Investigate why non-interactive
-pmode can hang on a single-word prompt — this points to something in the request/response handling layer, not just task complexity
Full troubleshooting screenshots (command chain + final interrupt) available on request.
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 by reproducing both kimi -p "hi" -m moonshot-cn/kimi-k3 and the interactive workflow described in the issue, then compare the CLI's request/response, tool-chain progress, and interrupt paths. Trace where output and Ctrl+C/Esc handling stop responding; done means both modes return promptly, show progress during tool calls, and interrupt reliably without exceeding the requested scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100