pi's extension guide regains its lifecycle diagrams, event-selection tables, and provider recipes after a docs refresh cut them
The only pull request pi merged on October 17, 2026 was christianklotz’s #11039, a docs-only restoration spanning the three extension-writing guides under packages/coding-agent/docs. It addresses #10297, an issue asking for the reference material a docs refresh (commit 25cc5c, per the issue) had removed — the lifecycle diagram, the per-hook reference sections, TUI component examples, and custom-provider configuration among them. The issue remains open; the pull request’s own summary scopes what it puts back: hook-aware diagrams for agent runs and session replacement, event-selection and handler-composition rules, a curated map of checked extension examples, and complete TUI and provider recipes. It is also the second such restoration from the same author in two days — #11038 rebuilt the models.json field reference from schemas the day before.
extensions.md gets the hook sequence back as a mermaid flowchart: a normal prompt runs from input through before_agent_start, the model-turn events, and the tool hooks to agent_end, then branches through agent_before_settle to agent_settled. A second diagram covers session startup and replacement — project_trust, session_start, and the session_before_switch and session_before_fork paths that /new, /resume, /fork, /clone, and reload take through session_shutdown. An event-groups table sorts the hooks into seven areas, and a choose-an-event-by-intent table maps thirteen goals — filtering context for one provider request, authorizing a tool call, notification work after automatic processing stops — onto the event that serves them.
A handler-composition table spells out six ways handlers combine: notification, in-place mutation, chained transformation, gate, actionable boundary, and last override, where the last cache_warming_decision handler returning an action wins. The Examples and reference section becomes a goal-to-example map over nine checked extension examples — permission-gate.ts for tool-call gating with fail-closed behavior, qna.ts for cancellable model work behind a command, ssh.ts for routing built-in tools to another machine, custom-provider-gitlab-duo/ for OAuth plus provider-specific streaming among them.
tui.md gains one complete custom screen: a pick-target command whose ctx.ui.custom() component caches its rendered lines per width, matches injected keybindings for up, down, confirm, and cancel, invalidates cached output after state changes, and finishes through done(). A closing note marks the Focusable boundary: a component without a text cursor needs none, while one embedding Input or Editor must implement Focusable and propagate its focused value to that child.
custom-provider.md turns its guidance into three recipes. Redirect an existing provider by registering only baseUrl and headers, keeping the built-in catalog — copying the model list into the extension would turn a small endpoint override into a catalog replacement that can drift. Register a compatible endpoint with just the models a service actually exposes, preferring models.json when no executable extension behavior is needed. The existing mixed-operation example keeps its place under its own heading.
The +239/−11 diff touches only the three guides. v1.3.0 was tagged two days before the merge, so the restored material rides main toward whatever release follows it; the complete diff is on the pull request page.