Add hook config write API#19840
Add hook config write API#19840abhinav-oai wants to merge 1 commit intodev/abhinav/hooks-list-configfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1307c251a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let key = format!( | ||
| "{}:{}:{}:{}", | ||
| source.key_prefix, | ||
| hook_event_key_label(event_name), | ||
| group_index, | ||
| handler_index |
There was a problem hiding this comment.
Use durable hook IDs instead of positional key indices
Hook keys are persisted and later used for enable/disable, but the key is derived from group_index/handler_index. Reordering or inserting hooks in the source file changes indices, so an existing [[hooks.config]] entry can target a different hook (or none) on the next load. This can silently disable/enable the wrong command after config/plugin updates.
Useful? React with 👍 / 👎.
Why
After
hooks/listexposes the hook inventory, clients need a follow-up control surface that can persist user choices for hooksWhat
hooks/config/writefor user-level hook enablement changes.hooks/listentries with the current selector key and effective enabled state so clients can render toggles.[[hooks.config]]and filters disabled non-managed hooks out of runtime execution.Verification
hooks/config/writeand re-listing a disabled hook.Stack