You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Intermittent: post-action hook messages missing from the next-turn request after session resume (pre-action always delivered) #4174
A conformance rig that drives kimi headless (CLI, print/headless mode with session resume) observes that post-action hook messages are intermittently not delivered to the next turn, while pre-action hook messages are always delivered. The delivery mechanism itself works when the messages do arrive (user-role hook_result).
Scenario
An external harness launches kimi headless against a scratch project with hooks configured.
Hooks run checks around tool calls:
a pre-action check (before Write|Edit) that must stay silent in the turn it fires and appear in the next turn's request body as a user-role hook_result message ("before Write");
a post-action check (after Write|Edit) with the same held-delivery contract ("after Edit");
a post-guard on Bash with the same contract ("after Bash").
The harness launches a session, then resumes it (--resume <session_id>, headless) and inspects the outgoing request bodies.
Observed
Seven assertions per run; six are consistently green. The intermittent one is the post-action Write|Edit warning:
Check
Result
pre-action warning delivered next turn ("before Write")
✅ always
post-action warning delivered next turn ("after Edit")
❌ intermittent
post-action Bash warning delivered next turn ("after Bash")
✅ in 3 of 4 failing runs (failed once alongside the Edit check)
delivered as user-role hook_result
✅ when present
silent in the turn they fire
✅
Timeline (all runs on the identical binary, same sha256):
2026-10-08 06:13 UTC — post-action Edit check failed
2026-10-08 06:16 UTC — same tree, same binary: all 7 passed
2026-10-11 02:04 / 02:06 / 02:07 UTC — three consecutive runs on two different source trees (one of them a clean control tree): same single check failed each time
The two source trees differ substantially; the failure signature is identical and binary-independent.
Environment
@moonshot-ai/kimi-codev2.1.1, Linux x64
binary: /usr/bin/kimi → dist/main.mjs
sha256 2563a338c94868a34e1bfd2e5579067d5a472acf4cb0bf350a3bfe1092bbe59d (identical across every pass and fail above; installed 2026-10-08 00:33 +0200, so the 10-08 pass and fail ran on this same build)
Expected vs actual
Expected: held post-action warnings always appear in the next turn's request after resume, as user-role hook_result.
Actual: the post-action ("after Edit") warning is sometimes absent from the next-turn body; the pre-action one is never absent.
Notes
Since the binary is unchanged between pass and fail, the nondeterminism likely sits in the message-assembly/resume path — possibly influenced by model/server-side behavior — rather than in local code.
I can provide redacted request/response captures from failing and passing runs on request; the harness is private, but the wire-level evidence is exportable.
Thanks for taking a look — this one intermittently blocks a release gate that requires an all-green run.
Summary
A conformance rig that drives
kimiheadless (CLI, print/headless mode with session resume) observes that post-action hook messages are intermittently not delivered to the next turn, while pre-action hook messages are always delivered. The delivery mechanism itself works when the messages do arrive (user-rolehook_result).Scenario
kimiheadless against a scratch project with hooks configured.hook_resultmessage ("before Write");--resume <session_id>, headless) and inspects the outgoing request bodies.Observed
Seven assertions per run; six are consistently green. The intermittent one is the post-action Write|Edit warning:
hook_resultTimeline (all runs on the identical binary, same sha256):
The two source trees differ substantially; the failure signature is identical and binary-independent.
Environment
@moonshot-ai/kimi-codev2.1.1, Linux x64/usr/bin/kimi→dist/main.mjs2563a338c94868a34e1bfd2e5579067d5a472acf4cb0bf350a3bfe1092bbe59d(identical across every pass and fail above; installed 2026-10-08 00:33 +0200, so the 10-08 pass and fail ran on this same build)Expected vs actual
hook_result.Notes
Thanks for taking a look — this one intermittently blocks a release gate that requires an all-green run.