Skip to content

v0.12.4

Choose a tag to compare

@mikehasa mikehasa released this 25 Sep 00:43
· 15 commits to main since this release
14c72a9

Kimi Code desktop sessions can now bind their work to the session.

Kimi Code's desktop app runs every session inside one main process, so a session's hook process and the MCP server share that main pid as their only common ancestor: pid lineage matched every candidate at the same rank and id inheritance refused. Hook contexts now carry cwd_digest — a truncated SHA-256 of the session's cwd, never the raw path (project_label stays the basename) — and the MCP server matches on its own working directory, which IS its session's project directory.

  • The desktop app also hands hooks its OWN working directory, so the payload cwd is / for every session (measured: 64 of 64 PreToolUse payloads across five concurrent sessions); the hook now reads the session's real project directory from Kimi Code's own ~/.kimi-code/session_index.jsonl (sessionId -> workDir) and keeps the payload cwd only as the fallback when that index has no row.
  • The don't-guess rules hold: the digest decides only when every fresh candidate carries one and exactly one matches, a digest-less candidate turns the rule off (lineage or refusal decides instead), and two sessions opened on the same directory refuse id inheritance outright rather than falling back to newest-or-lineage.
  • Claude Code and Codex contexts carry the digest too, since their hook payloads carry cwd as well.

Live hook firing has been observed on the maintainer machine (2026-09-24: 64 PreToolUse payloads across five sessions), but no live MCP report has yet inherited a session id — the running server predates this fix — so mechanical_capture stays experimental until that smoke exists.