Repository navigation
Description
What version of Kimi Code is running?
This happened in the Desktop Kimi Work / Daimon bundled runtime, not in the standalone console kimi command.
- Desktop Daimon releaseVersion:
0.5.27 - Bundled kimi-code runtime upstreamVersion:
0.12.3 - Bundled kimi-code upstreamCommit:
18f299fd0b266545a1f7cebae9f58b83b9d9776e - Runtime packages listed in the bundle:
@moonshot-ai/agent-core,@moonshot-ai/kimi-code-sdk,@moonshot-ai/kimi-code-oauth,@moonshot-ai/kimi-telemetry - Standalone console
kimi --versionon the same machine:kimi, version 1.41.0(included for clarity; this was not the process tree that exploded)
Which open platform/subscription were you using?
Desktop Kimi Work / managed Daimon runtime, using daimon-kimi-code.
Which model were you using?
daimon-kimi-code
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Desktop Kimi Work / Daimon python-run spawned a runaway process tree on Windows:
- About
11,500python.exeprocesses were present. - Most of them came from the bundled Desktop Kimi Work runtime:
<user-profile>\AppData\Roaming\kimi-desktop\daimon-share\daimon\runtime\python\.venv\Scripts\python.exe
<user-profile>\AppData\Roaming\kimi-desktop\daimon-share\daimon\runtime\python\runner.py --module <user-profile>\AppData\Roaming\kimi-desktop\daimon-share\daimon\agents\main\code\python-run\<runId>\script.py --fn main --context <temp>\kimi-daimon-python-...\context.json
- The process tree looked like repeated
python.exe -> python.exe -> python.exeparent/child chaining with the same runner command line. - CPU was saturated at
100%;% Idle Timewas0. - Windows
Processor Queue Lengthwas observed in the high double digits to thousands during the incident. - The Python process storm accounted for roughly
47.6 GBof RAM. - Many processes were tiny, around
4 MBworking set each, which made it look like a runaway spawn/respawn loop rather than one normal heavy Python job. vmmem, WSL, Docker, and Hyper-V were checked separately and ruled out as the culprit. WSL distros were stopped, Docker was not active, and the Hyper-Vvmmemprocesses corresponded to legitimate VMs.
The specific task context found locally:
scope: interactive
runId/taskId: 7c77a250-cd24-4a3c-9710-0fe66de8951a
triggeredAt: 2026-06-25T19:40:15.648Z
runtimeRoot: <user-profile>\AppData\Roaming\kimi-desktop\daimon-share\daimon\runtime\python
The user script for that task was inspected locally. It was a normal JSON/text-processing script and did not contain direct process-spawning calls such as subprocess, multiprocessing, Popen, os.system, fork, or spawn.
What steps can reproduce the bug?
I do not have a deterministic minimal reproduction yet. This was observed from the live Windows process table after a Desktop Kimi Work interactive python-run task.
The observed trigger was:
- Use Desktop Kimi Work on Windows.
- Let it run an interactive Python tool task using the bundled Daimon runtime.
- The task command line matched:
<daimon>\runtime\python\.venv\Scripts\python.exe <daimon>\runtime\python\runner.py --module <daimon>\agents\main\code\python-run\<runId>\script.py --fn main --context <temp>\kimi-daimon-python-...\context.json
- Instead of one bounded Python execution, the machine accumulated thousands of identical/similar
python.exerunner processes until the OS was effectively saturated.
What is the expected behavior?
python-run should execute as a bounded task:
- one primary runner process, or a small bounded process tree;
- no self-replicating
runner.pychain; - per-task process limits on Windows;
- robust cleanup of the whole task process tree on completion, failure, cancellation, or agent/runtime restart;
- timeout and respawn-loop protection;
- diagnostic logging when a tool task attempts to spawn an abnormal number of child processes.
Additional information
Recovery required killing the storm and temporarily disabling the bundled task/runtime entry points to stop respawning:
<daimon>\agents\main\code\python-run\<runId>\script.py
<daimon>\runtime\python\runner.py
<daimon>\runtime\python\.venv\Scripts\python.exe
After cleanup:
ExactKimiRuntimePython: 0
PythonTotal: 13
SmallUnder10MB: 0
ProcessTotal: 265
ProcessorQueueLength: 0
I am intentionally not attaching config.json, raw context files, full local logs, or screenshots because they may contain tokens, credentials, private paths, or local workspace data. I can provide redacted diagnostics if needed.
Duplicate search performed before filing
I searched open and closed issues/PRs in this repository before opening this:
- Issues:
python-run,runner.py,daimon,python.exe,thousands python,many python,process storm,fork bomb,CPU 100,memory leak,runaway,Desktop Kimi Work,Kimi Work,vmmem,python runner - PRs:
python-run,runner.py,daimon,python.exe,process storm,fork bomb,spawn,runaway,Desktop Kimi Work,Kimi Work
Closest non-duplicates I found:
- Windows 开发脚本 spawn EINVAL + thinking 刷新率过高导致闪烁 #234: Windows dev script
spawn EINVAL/ thinking refresh flicker, but not a Python runner process storm. - [Bug] Provider API error 400: assistant message with 'tool_calls' missing corresponding tool response (tool_call_id Read:158) #705: provider API/tool call mismatch, unrelated to local process spawning.
- MCP stdio server crashes on Windows with UnicodeEncodeError: 'charmap' codec can't encode character '\u2713' #886 / fix(agent-core): force UTF-8 for Python MCP stdio servers on Windows #899 / fix(mcp): force UTF-8 encoding for Python stdio servers on Windows #909: Windows Python MCP stdio encoding fixes, unrelated to runaway
python-run. - fix(agent-core): terminate MCP stdio process tree on close #1038 / fix: clean up background tasks on session exit #641: process-tree/background cleanup work, possibly adjacent, but not this specific
python-runWindows process storm.
Activity
nBn4u commentedon Oct 7, 2026
Follow-up, 2026-10-07: source/history review from the reported bundled SHA
18f299fthrough kimi-code 2.1.1 (f67e639). I could not identify a public fix for this Desktop/Daimonpython-runspawn storm. No Windows runtime retest was performed.LocalProcess.kill()to always usetaskkill /T /F; fix(agent-core-v2): keep session deletion from hanging #3887 bounds the v2taskkillwait to 5 seconds and terminates a stuck helper. These improve managed-process teardown, but do not demonstrate a fix for recursiverunner.pyspawning.python-run/runner.pyimplementation in this public repository, so a separate Desktop fix cannot be verified here.Retest: use the actual current Desktop/Daimon bundle and record Desktop version, bundled engine SHA and Python runner version. Repeat a bounded JSON/text
python-run; exercise success, exception, timeout/cancel, session close/delete and app quit/restart. Check bounded per-run PID counts, absence of recursive runner chains, cleanup of descendants including the parent-exits-first case, and bounded spawn/retry behavior. Capture redacted PID/PPID/command-line timestamps and spawn/retry/exit logs. A standalone CLI update alone does not validate the bundled runtime.Maintainers: has the Desktop/Daimon runner been fixed separately? Please identify the fixing commit/PR, regression test and first Desktop release/bundled SHA, including which Windows containment and spawn/respawn protections cover
python-run. Otherwise, please confirm this remains outstanding, the owning tracker, and which redacted diagnostics would help.