Repository navigation
feat(cli): deliver session start and prompt hooks to kimi plugins - #1404
Merged
Merged
Conversation
Kimi reads a plugin's hooks from its manifest, so the plugin build lists the SessionStart and UserPromptSubmit hooks inline, run from the plugin root, and ships the scripts with a Kimi host adapter generated from the shared parts. An event Kimi never fired in a capture is reported by the build. Refusing a tool call and continuing a turn stay undelivered: no answer to either was seen taking effect. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hook merge and Kimi's manifest each mapped events to a tool's own and reported the ones it never fires; both now go through routeEvents. The events of a hooks file have one reader, and the plugin presence reads them only when a manifest asks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…prompt shape Co-Authored-By: Claude Opus 5.5 <[email protected]>
…file out The Kimi manifest is the one stage that reads the plugin's events: it lists the hooks and reports each event Kimi never fires. The hook merge, Kimi and Kiro share one router, which shapes each routed event itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… share one event router Kimi's fact that its manifest lists the hooks moves into declareHooks, and pluginTreeHooksArtifact derives the skipped hooks file from it. The wrapped command merge maps an event through the shared router, the plugin hooks parse is memoized, and the SessionStart limit is stated as unverified. Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts: # cli/src/contexts/tools/domain/hooks/wrapped-command-hooks-merge.ts
| current = { | ||
| host: HOST, | ||
| event, | ||
| files: filesOf(event, writtenFiles(tool, input, cwd, raw.tool_response)), |
This was referenced Nov 26, 2026
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.
Summary
Kimi plugins now receive the framework's hooks for the events a real logged-in capture showed firing:
SessionStartandUserPromptSubmit.hooksfield, using onlyevent,matcher,commandandtimeout.${CLAUDE_PLUGIN_ROOT}/becomes./, because Kimi runs a plugin hook from the plugin root.hooks/hooks.jsonis left out of the tree. A descriptor field,manifestListsHooks, drives that.hooks-runtime/parts/.Object.hasOwnguard.hooks.jsonis parsed once per build.scripts/__tests__/fixtures/hook-payloads/kimi-*.json(Kimi 0.42.0).Limits, in
docs/COMPATIBILITY.md:UserPromptSubmitcarriespromptas a list of text parts, not a string.SessionStartoutput reaches the model is unverified, because the probe account's model turns were refused (403, no Kimi Code subscription).Stopwere never reached, so they are not delivered.Each kept test is mutation-proven. Redundant mirror tests were deleted.
Supersedes #1344, whose Kimi work this takes over.
🤖 Generated with Claude Code