feat(kimi): modularisation + lifecycle and observation fixes - #106
Merged
Merged
Conversation
- broke out kimi hook into structured module + tests - fixed stop semantics to signal proper listen + notify - gate tool for session end and guard primary - finalise when pid alive or launched+bound -> mirror omp - deny orphan bind and dual-prefix hook (hcom vs uvx hcom bug)
- No-op PostToolUse/Notification so ignored hook output cannot advance the cursor - Defer Stop delivery_ack until Block stdout is written (HookResult::Block field) - Unit-test the cursor invariant; pending Stop stays active until empty Stop
Owner
|
nice |
orgoj
added a commit
to orgoj/hcom
that referenced
this pull request
Sep 13, 2026
… module) Upstream fabb309 brings the runner Node-precedence fix (aannoo#117), the grown CODEX_HOME resolution (aannoo#115), Ptyxis support (aannoo#113), the Windows nested PowerShell removal (aannoo#137) and the kimi modularisation (aannoo#106). Conflicts resolved in upstream's favour: - codex.rs / codex_preprocessing.rs: the fork's cherry-picked 080c78a used a thread-local CODEX_HOME override; upstream's explicit `*_at` threading replaces it, so the wrapper functions and the thread-local are dropped. - launcher.rs: upstream's case-insensitive effective-env helpers and the earlier canonical_dir are taken; the fork's per-instance system-prompt path stays and upstream's global gemini system-prompt block is dropped. - kimi: upstream's src/hooks/kimi/ module replaces the fork's kimi.rs (it already carries the fork's lifecycle and observation fixes); only the fork's nested-identity gate `hook_gate_check_for_tools` is re-applied. - terminal_presets: expected preset count raised to 30 for Ptyxis. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WDRs6TVA2uSBXG2TQacFRf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Live multi-agent decks (kimi + omp/codex partners) were dropping kimi identity and "losing" inbound messages mid-turn. Hard
SessionEnd, dualhcom/uvx hcomhook rows, and missing empty-Stop → listening left agents orphaned or stuckactive. Separately, Kimi treats PostToolUse/Notification as observation-only, but hcom still prepared and acked pending delivery there — the cursor advanced while the model never saw the text. This branch modularises the kimi hook surface (same layout as omp) and fixes those lifecycle and observation bugs together so the behaviour is reviewable and the file is easier to extend.Summary
kimi.rsintokimi/{mod,config,handlers,tests}.rs(omp-style module layout).directoryfield fix.delivery_ackuntil Block stdout; UPS unchanged.Test plan
cargo test -p hcom hooks::kimicargo fmt/cargo clippy -p hcom -- -D warnings