Repository navigation
Proposal: the hook events each client version supports, and reporting a hook a client does not run #101
cardene777
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
A companion proposal covers rules as a plugin component: #100.
Discussion-first proposal per CONTRIBUTING.md. Related threads: #54 proposed the portable hooks component, and #89 brought portable lifecycle hooks into v1.1; this proposal adds what happens to a handler a client does not run.
Summary
Portable lifecycle hooks in v1.1 define five events.
Clients reach those events, and the fields around them, at different versions, and will add more events at different times.
This proposal asks that a client report every handler of an enabled plugin it does not run, and that the project keep a table of the events each client version supports.
Problem
A plugin that declares a hook cannot tell whether the installed client will run it.
When a client skips a handler without a word, a guard hook that was meant to stop a dangerous command gives a false sense of safety.
Client support moves with versions, for example:
The incubation pull request for portable hooks asked how a host that cannot run a hook should report it, and the question has no answer in the specification yet.
Who hits it
Why it belongs in the portable specification
Whether a skipped hook is reported is a portability guarantee: a plugin author can rely on it only if every client gives it.
A message in one client's own words does not let a plugin, a registry, or an installer check support before enabling a plugin.
Proposed shape
Evidence
agent-shared (definition) keeps such a table for the clients it places hooks into, as
eventsandcheckedon each row of its agent table:When a hook's event is not in a client's row, the hook is left out of that client and the run names it, for example
left the ConfigChange hook ... out of Codex: it reads no ConfigChange event.When the installed client is older than the lowest version checked, nothing is written for that client and the run says so; a newer version is written and named, since clients release often.
Who would adopt it
Open questions
This proposal was prepared with an AI coding agent and reviewed by me.
All reactions