docs(agent): document per-event extra keys in shell-hook wire protocol - #49382
docs(agent): document per-event extra keys in shell-hook wire protocol#49382ken-jo wants to merge 1 commit into
Conversation
|
Closing as a duplicate of #49392, which documents the same shell-hook per-event extra keys in |
|
Thanks @teknium1 — fair call, #49392 did read as more complete at the time. Two things for the record, and a small ask: This is the canonical/first version. #49382 was opened 2026-06-20 02:51, ~29 min before #49392 (03:20), and both close #49370. The #49392 author confirmed it in their own thread:
It's now strictly more complete than #49392. I just pushed a follow-up to this branch that documents all six shell-hook lifecycle sites — including Since #49944 is salvaging older validated docs PRs with authorship preserved, could this canonical version be the one reopened/salvaged? Happy to rebase onto current |
|
Since I can't reopen this as the author (GitHub blocks author-reopen on a maintainer-closed PR), I've carried the completed canonical version forward in #49969 — it now covers all six shell-hook sites (incl. |
The shell-hook wire-protocol docstring in
agent/shell_hooks.pydocuments the top-level stdin shape, including theextraobject, but not which keys each event puts inside it. Since_serialize_payloadfolds all non-top-level kwargs intoextra, the genuinely useful per-event fields (tool result/status, the subagent child id, session-end flags) are only reachable there, and a hook author can't discover them without reading the emit sites.This adds a short per-event table right after the
extraline listing the common keys forpost_tool_call,subagent_stop,on_session_end, andon_session_start. Field names verified against the emit sites inmodel_tools.py,tools/delegate_tool.py,agent/turn_finalizer.py, andagent/conversation_loop.py.Docstring-only; no code change. Happy to move it to the README or a docs page instead, or trim/expand the key list if you'd prefer.
Closes #49370