fix: detect Kimi Code CLI under ~/.kimi-code#274
Conversation
Prefer the official kimi-code home over legacy ~/.kimi so Settings hooks detection, install/uninstall, and session discovery work with current Kimi Code CLI installs.
Allow index-based discovery without requiring sessions/ dirs, and load recent messages from agents/main/wire.jsonl for kimi-code sessions.
Parse content-part array prompts on UserPromptSubmit, and read the kimi-code wire protocol (turn.prompt / content.part) while keeping legacy kimi-cli TurnBegin transcripts working.
wxtsky/CodeIsland quiet for 12 days (HEAD still 3e2aec7 / v1.0.30). New PRs wxtsky#274-wxtsky#276 are non-Claude CLIs or out of scope. vibeislandapp/vibe-island unchanged since Jul 17 (docs only). All open tasks T-016 through T-079 unchanged.
|
Merged (48f2cdc) — the path-migration handling checked out against Kimi's data-locations / hooks / migration docs. Three LOW-severity notes from review, recorded as welcome follow-ups: (a) |
|
Follow-up for the three LOW notes is in #285:
|
Summary
~/.kimi-code(old path was~/.kimi). Settings → Hooks correctly detects current installs again; legacy~/.kimistill works.config.toml.session_index.jsonl+ transcript), and keep the old kimi-cli path as fallback.promptonUserPromptSubmit, and read kimi-codewire.jsonl(turn.prompt/content.part) so the notch shows dialogue (legacy TurnBegin format still works).kimi-code(and similar names) as the same source askimi.Note: After changing hooks config, restart the kimi session for hooks to take effect (official behavior; a long-lived session will not pick up new hooks).
Refs: Kimi Code CLI hooks, migration guide.
中文说明
~/.kimi-code(旧版是~/.kimi)。Settings → Hooks 能正确识别新安装;旧路径仍兼容。config.toml。prompt,以及新版wire.jsonl,岛上能显示用户/助手消息。kimi-code等名称统一当作kimi。注意: 修改 hooks 配置后需要重开 kimi 会话才会生效(官方行为;长驻旧会话不会自动加载新 hooks)。
参考:Kimi Code CLI hooks、迁移指南。
Test Plan
ConfigInstallerTests(kimi home / install / uninstall) — 0 failuresKimiHookPayloadTests— content-part array prompt → chat text; plain string still worksKimiTranscriptTests— kimi-code wire + legacy TurnBegin~/.kimi-codepresent and~/.kimiabsent: detection / preferred home →~/.kimi-code~/.kimistill detects / installs / discovers as before