MoonshotAI / MoonshotAI/kimi-code
Process title (argv0) truncated to 'kimi-co' on session resume (-S) — breaks process-name-based agent detection
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Summary
When a Kimi Code session is resumed with kimi -S <session-id> (also observed on a fresh kimi -y launch on macOS — see herdrdev/herdr#3707), the process title is truncated to kimi-co instead of the full kimi-code. Fresh non-resume launches on Linux set the full title.
Downstream impact: terminal multiplexers / agent managers that detect a running kimi process by argv0 prefix (e.g. herdr) fail to recognize resumed sessions.
Environment
- kimi-code 0.x (installed via npm,
~/.kimi-code/bin/kimi), Ubuntu 24.04, Linux 6.x - Observed 2026-09-06; also reported on macOS in herdrdev/herdr#3707
Reproduction
- Start a session:
kimiin a terminal, note the session id. - Exit, then resume:
kimi -S <session-id>. - In another shell:
ps -o pid,comm,args -p <pid>—commshowskimi-co(15-char kernel comm limit is NOT the cause; argv0 inargsis alsokimi-co …, and fresh launches show the fullkimi-code).
Expected
argv0 stays kimi-code (or the full configured title) regardless of fresh vs resumed session, so process-name detection is stable.
Notes
Likely a length-limited process-title write in the resume path (setproctitle-style). A safe alternative for downstream tooling is matching by executable path (/proc/<pid>/exe), but stable argv0 from kimi itself is the cleaner fix. Cross-reference: herdrdev/herdr#3707.
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
Reproduce the issue with a fresh kimi launch and a resumed kimi -S <session-id> session, then inspect ps -o pid,comm,args to compare argv0 values. Trace the resume path and its process-title write; done means both fresh and resumed sessions consistently expose kimi-code or the full configured title, with process-name detection no longer failing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 66/100