MoonshotAI / MoonshotAI/kimi-code

[Bug] Process hard-crashes after AgentSwarm call (no logs) + libuv assertion failure on `kimi update` exit (Windows)

Open
#3,189 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Summary

Kimi Code v0.38.0 on Windows 11 x64 hard-crashes (process disappears without any logs) right after invoking the AgentSwarm tool. A related libuv assertion failure also occurs on kimi update exit. Both point to async handle / lifecycle management issues.


Bug 1: Hard crash after AgentSwarm call (no logs, no error)

Steps / context

  • Long-running session; after several tool calls the agent invoked AgentSwarm (parallel spawn of 10 coder sub-agents).
  • The main process disappeared immediately after the tool.call AgentSwarm entry — no tool.result, no error event, no crash dump.
  • kimi-code.log had zero writes for that day (nothing flushed before the crash).
  • wire.jsonl ends at tool.call with name AgentSwarm with no following result.

Preceding state

  • In the ~20 minutes before the crash, LLM requests had repeatedly failed with provider.api_error ("The API returned an empty response...") and the client retried several times. The session then triggered AgentSwarm while in this degraded state.
  • A few minutes earlier, a single Agent sub-agent call completed fine; the crash happened specifically on the swarm (multi-sub-agent) call.

Expected

  • Sub-agent failures should be isolated; an upstream/LLM error must never be able to kill the whole process. At minimum an error should be recorded before exit.

Evidence

  • wire.jsonl tail:/n```
    04:35:13 tool.call Agent <- OK, sub-agent started
    04:35:13 tool.result (task started)
    04:35:13 step.end tool_use
    04:35:41 tool.call AgentSwarm <- process disappears here, no result

---

## Bug 2: libuv assertion failure on `kimi update` exit

Running `kimi update` prints `Kimi Code is already up to date (v0.38.0).` and then crashes during teardown:/n/n```
Assertion failed: !(handle->flags & UV_HANDLE_CLOSING), file src\win\async.c, line 76

This is a libuv async-handle state assertion (Windows event loop). It does not affect the update result, but it is a process-level abort that confirms async handle lifecycle bugs in the CLI.


Environment

  • OS: Windows 11 x64
  • Kimi Code version: 0.38.0
  • Crash signature: process terminates silently; no log flush, no dump

Happy to provide more logs (session wire.jsonl / rollout.log excerpts) on request.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the AgentSwarm crash and the kimi update teardown assertion on Windows 11 x64, using the reported Kimi Code v0.38.0 context. Inspect the final entries in wire.jsonl, kimi-code.log, and any rollout.log excerpts; done means sub-agent or provider failures no longer terminate the process silently and kimi update exits without the libuv assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.