Skip to content

Kimi CLI hangs after detached child-process tool call #2468

Description

@N0zoM1z0

What version of Kimi Code CLI is running?

Kimi CLI 1.47.0.

Which open platform/subscription were you using?

API-compatible local mock provider with a fake API key.

Which model were you using?

OpenAI-compatible local mock provider.

What platform is your computer?

Linux x86_64 Docker.

What issue are you seeing?

When Kimi CLI receives a shell tool call that starts a detached child process, the CLI does not return control within the bounded run. The standalone reproducer downloads public Kimi CLI 1.47.0, starts a local OpenAI-compatible mock provider, sends a child-spawning shell tool call, and verifies the behavior without requiring this repository or any private fuzzing harness.

Kimi CLI accepts the child-spawning shell tool call, records the detached child PID side effect, and then fails to finish normally before the bounded timeout. The reproducer prints REPRODUCED only when provider traffic is observed, the child-spawning command records its PID, and the CLI exits by timeout or signal.

What steps can reproduce the bug?

Prerequisites: Docker, Python 3, and the GitHub CLI (gh) for the clone command below. The linked reproducer is self-contained and uses only Python standard-library modules plus Docker. It downloads the affected public Linux release asset, starts a local mock provider, and runs the CLI in an isolated workspace. The Docker run is limited to 2 CPUs and 4 GiB RAM by default.

Complete self-contained reproducer: https://gist.github.com/N0zoM1z0/707db65552981ab1c84109517315bd2f

The Gist contains kimi-cli-child-process-cleanup.reproduce.py. Download and run:

gh gist clone 707db65552981ab1c84109517315bd2f kimi-cli-child-process-cleanup-reproducer
cd kimi-cli-child-process-cleanup-reproducer
python3 kimi-cli-child-process-cleanup.reproduce.py

To reuse an already-built local image:

python3 kimi-cli-child-process-cleanup.reproduce.py --skip-build

Key output from a local run against the affected version:

provider_requests_at_least: observed=... expected>=1
side_effect_file_exists detached-child.pid: bytes=... expected>=1
timeout_or_signal: returncode=... timed_out=True
REPRODUCED

What is the expected behavior?

Kimi CLI should track, terminate, and reap tool-started child processes, then return control without hanging.

Additional information

  • Target: MoonshotAI/kimi-cli
  • Affected version checked with the public reproducer: 1.47.0
  • Current public latest checked on 2026-06-22: GitHub release 1.47.0
  • Environment: Linux x86_64 Docker, public release asset
  • Provider/model: local OpenAI-compatible mock provider, gpt-4o

This report targets stock public Kimi CLI 1.47.0 from the GitHub release asset. No upstream issue has been filed from this draft yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions