kimi-cli crashes with SIGSEGV on Python 3.14.0a6 due to PyYAML C extension ABI incompatibility

Open
#2,166 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
cli

Research direction

Reproduce the crash with uv tool install kimi-cli --python 3.14, then trace the import path through yaml/cyaml.py, yaml/__init__.py, kimi_cli/agentspec.py, and kimi_cli/cli/info.py. Inspect how PyYAML and related C extensions are selected or built for Python 3.14. Done means kimi info and kimi no longer segfault on the reported environment while the documented Python 3.12 workaround remains understood.

Written by the indexing model from the issue text.

Description

Description

Installing kimi-cli with Python 3.14+ (required by kimi term / Toad) causes a segmentation fault when running any non-trivial command (e.g., kimi, kimi info). Commands like --help and --version work fine because they don't trigger the full import chain.

Environment

  • OS: macOS 25.3.0 arm64 (Darwin)
  • kimi-cli version: 1.41.0
  • Python version: 3.14.0a6 (cpython-3.14.0a6-macos-aarch64-none)
  • Installation method: uv tool install kimi-cli (defaults to Python 3.14)

Steps to Reproduce

uv tool install kimi-cli --python 3.14
kimi info    # SIGSEGV (exit code 139)
kimi         # SIGSEGV (exit code 139)

Root Cause

The crash happens in the PyYAML C extension yaml._yaml (_yaml.cpython-314-darwin.so). The extension is compiled for Python 3.14 but appears to have an ABI incompatibility with Python 3.14.0a6, causing a segfault at import time.

Faulthandler Traceback

Fatal Python error: Segmentation fault

Current thread 0x00000001f093b100 (most recent call first):
  File "<frozen importlib._bootstrap>", line 488 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1064 in exec_module
  ...
  File "yaml/cyaml.py", line 7 in <module>
  File "yaml/__init__.py", line 13 in <module>
  File "kimi_cli/agentspec.py", line 7 in <module>
  File "kimi_cli/cli/info.py", line 18 in _collect_info
  ...

Extension modules: setproctitle._setproctitle, yaml._yaml (total: 2)

Workaround

Force installation with a stable Python version:

uv tool install --reinstall kimi-cli --python 3.12

However, this prevents using kimi term which explicitly requires Python 3.14+:

$ kimi term
`kimi term` requires Python 3.14+ because Toad requires it.

Impact

Users are stuck in a dilemma:

  • Python 3.14 → kimi term works but kimi-cli itself crashes
  • Python 3.12/3.13 → kimi-cli works but kimi term is unavailable

Suggested Fix

Ensure PyYAML and other C extensions (e.g., setproctitle) are compiled with full ABI compatibility for Python 3.14, or consider using a pure-Python YAML fallback on Python 3.14 until the ecosystem stabilizes.

Dominant language
Python
Stars
11.4k
Forks
1.3k
Avg merge
9h 47m
Merged PRs (30d)
2

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.

More from MoonshotAI/kimi-cli

All issues in MoonshotAI/kimi-cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.