Repository navigation
Description
Version: kimi-code 0.34.0 (macOS 15, arm64, ~/.kimi-code/bin/kimi, auto-updated from 0.33.0 on 2026-08-10)
Config: ~/.kimi-code/config.toml — two [[hooks]] entries (SessionStart, SessionEnd). kimi doctor reports the file valid.
Summary
After auto-updating from 0.33.0 to 0.34.0, the interactive TUI never executes any configured [[hooks]] — verified for SessionStart, UserPromptSubmit, and SessionHeartbeat. The same config works correctly in headless mode (kimi -p), where SessionStart fires and the hook command runs. On 0.33.0 the same hooks fired reliably in interactive sessions (daily use for weeks).
Config
[[hooks]]
event = "SessionStart"
command = "/Applications/QuotaWidget.app/Contents/MacOS/QuotaWidget --session-start"
timeout = 5
[[hooks]]
event = "SessionEnd"
command = "/Applications/QuotaWidget.app/Contents/MacOS/QuotaWidget --session-end"
timeout = 5(The hook launches a floating quota-widget; this is how the regression was noticed — the widget stopped auto-starting.)
Steps to reproduce
-
Add a probe hook to
~/.kimi-code/config.toml:[[hooks]] event = "SessionStart" command = "/bin/bash -c 'echo $(date -u +%FT%TZ) SessionStart >> /tmp/hook-probe.log'" [[hooks]] event = "UserPromptSubmit" command = "/bin/bash -c 'echo $(date -u +%FT%TZ) UserPromptSubmit >> /tmp/hook-probe.log'" [[hooks]] event = "SessionHeartbeat" command = "/bin/bash -c 'echo $(date -u +%FT%TZ) SessionHeartbeat >> /tmp/hook-probe.log'"
-
Start an interactive TUI session (also reproducible under a pty:
(printf 'hi\n'; sleep 80) | script -q /tmp/tui.log kimi), send a message, wait 80 s. -
Observe:
/tmp/hook-probe.logis never created — none of the three events fire. -
Control:
kimi -p "hi"with the same config →/tmp/hook-probe.loggets aSessionStartline and the hook command executes successfully.
Observed vs expected
- Expected (per docs and 0.33.0 behavior): interactive sessions fire hooks identically to headless ones.
- Actual: interactive TUI silently runs zero hooks; no warning, no log line,
kimi doctorsays everything is valid.
Additional clues
- Running the same binary with
KIMI_CODE_LEGACY_FLAG=1surfaced the only feedback anywhere: the TUI rendered a warning "Ignored invalid config in ~/.kimi-code/config.toml: hooks. Runkimi doctorfor details." — whilekimi doctorreports all config files valid. (Caveat: at that moment the config also contained the three probe hooks above; the warning may concern one of the newer event names. Either way, the legacy engine says the hooks section is invalid and doctor disagrees.) - The default (v2) engine shows no such warning — it just never runs the hooks, which matches the silent-failure pattern described in Hook command spawn failures are completely silent — no log, no diagnostic, kimi doctor reports OK #2766 (
loadSafe()/trigger()swallow everything). - Possibly related to Interactive sessions ignore [[hooks]] and [[permission.rules]] from config.toml; headless (-p) sessions enforce them (0.28.1, Windows) #2070 (interactive sessions ignoring
[[hooks]]), but note that on macOS this is a regression between 0.33.0 and 0.34.0: 0.33.0 interactive sessions fired these hooks correctly.
Impact
Any tooling that keys off SessionStart/SessionEnd (launch-on-start widgets, session trackers) or UserPromptSubmit (context injection) silently stops working in the primary interactive use case after the 0.34.0 auto-update, with no user-facing signal.
Happy to provide session ids / wire logs from the reproduction runs if useful.
Activity
SnowingFox commentedon Aug 11, 2026
Opened a PR to address this: #2822
fix: 16 verified ACP + engine + CLI regressions (post 0.36.0 sync) (#48)
mikallojjus commentedon Sep 23, 2026
Still reproduces on 2.0.2 (Windows 11) — interactive TUI never fires config hooks, headless works.
Setup: a single
[[hooks]]entry withevent = "Stop"in~/.kimi-code/config.toml, command is a bash script that appends a line to a log file on entry (so any invocation is detectable, even skips).Results:
kimi -p "..."from the same project directory → hook fires, script runs, checks execute. Reproducible every time.kimi, fresh session started after the config was already in place,kimi doctorreports config valid) → script never invoked; zero hook-related log lines in the session log; turn ends with no hook activity./reloaddoes not change this for the current session; starting a brand-new session afterwards also does not.So this is not macOS-only and not limited to SessionStart/SessionHeartbeat — the Stop event is affected too. The silent-failure pattern matches #2766 (spawn failures swallowed, no diagnostic anywhere).
fix(agent-core-v2): rebuild hook index on config change so late [[hoo…