Skip to content

docs(plugins): reconcile the hook reference with HookType (missing 9 hooks + 2 categories) #1743

Open

Description

@ajbozarth

The hook reference in docs/docs/concepts/plugins.mdx presents itself as exhaustive — "Plugins are organized into six hook categories" and "Enum with all 18 hook types" — but has drifted out of sync with the HookType enum (mellea/plugins/types.py), which now defines 27 hook types across 8 groups. So the doc both omits a third of the hooks and makes a false completeness claim.

Missing from the doc (9 hooks, 2 whole categories):

  • Generation: generation_batch_pre_call, generation_batch_post_call, generation_batch_error, generation_event — the doc lists only 3 of the 7 generation hooks.
  • Adapter functions: adapter_function_invocation_complete, adapter_function_phase_complete — category entirely absent.
  • Streaming: streaming_start, streaming_event, streaming_end — category entirely absent.

Why it matters: beyond the stale list, the "all 18" claim actively misleads. For example, sampling_loop_start is documented as firing "when a sampling strategy begins execution" with loop_budget writable — so a reader using stream(strategy=..., loop_budget=N) could reasonably expect it to fire and let them tune the budget, but streaming never fires the sampling_loop_* hooks (it uses the streaming_* hooks + RetryEvent). This surfaced in the #1697 review.

Fix — pick one direction:

  1. Exhaustive and kept so: document the 9 missing hooks + the Adapter and Streaming categories, correct the counts (6 → 8 categories, 18 → 27 hooks), and add a guard (a test or doc-gen step) that keeps the reference in sync with HookType so it can't silently drift again.
  2. Representative, not exhaustive: drop the completeness claim, keep a curated set of common hooks as examples, and link to the authoritative full list (the HookType enum / API reference). Lower maintenance; won't re-drift.

Scope: one doc file (docs/docs/concepts/plugins.mdx) plus HookType for the inventory; no runtime code. Good first issue — well-bounded, and a nice way to learn the hook surface.

Activity

  1. bernalalexis-try commented on Oct 16, 2026

    @bernalalexis-try

    Hi, I'd like to work on this one. I plan to take direction 1: document the 9 missing hooks and the Adapter and Streaming categories, fix the counts, and add a test that fails when a HookType member has no section or policy-table row in plugins.mdx.

  2. ajbozarth commented on Oct 16, 2026

    @ajbozarth
    MemberAuthor

    @bernalalexis-try thank you for the interest, feel free to open a PR when you have one ready and I'll review. I personally would have taken direction 2 as the easier option so I'm interested in what your PR will look like :)

  3. ajbozarth commented on Oct 28, 2026

    @ajbozarth
    MemberAuthor

    @bernalalexis-try are you still interested in working on this? No rush, just checking in since I hadn't seen a PR yet.

  4. bernalalexis-try commented on Oct 28, 2026

    @bernalalexis-try

    Sorry for the delay. PR is up: #1772. It takes direction 1 (documents the 9 missing hooks and the Adapter and Streaming categories, fixes the counts, and adds a test that fails when a HookType member has no section or policy table row).

  5. Ashutosh2407 commented on Oct 31, 2026

    @Ashutosh2407

    Hi, I’m new to this project and would like to work on this issue if it’s still open and valid. Could you assign it to me? Thanks!

  6. removed their assignment
    on Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomers

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions