Skip to content

Proposal: Extensible hooks and plugin support#414

Draft
araujof wants to merge 3 commits intogenerative-computing:mainfrom
araujof:feat/hooks_specification
Draft

Proposal: Extensible hooks and plugin support#414
araujof wants to merge 3 commits intogenerative-computing:mainfrom
araujof:feat/hooks_specification

Conversation

@araujof
Copy link

@araujof araujof commented Feb 5, 2026

Summary

Introduces a design specification for an extensible hook system and plugin framework for Mellea. The hook system provides extension points across the framework's execution lifecycle — from session initialization through component execution, LLM generation, validation, sampling, and cleanup — enabling policy enforcement, observability, customization, and integrations without modifying core library code.

Document Outline

  • Plugin framework design: Async hook API with typed payloads, read-only context, and result objects that can modify payloads or block execution. Plugins register via convention-based naming (on_<hook_name>), programmatic registration, or YAML configuration.
  • Hook points organized into categories that reflect Mellea's abstraction boundaries.
  • Execution model: Blocking (default) and fire-and-forget modes, priority-based ordering, and enforcement modes.
  • Concurrency semantics: Documents how Python's cooperative async model keeps hook execution deterministic when awaited, and where race conditions can arise.
  • Observability integration: Describes how hooks compose with OTel-instrumented LLM client libraries.
  • Error handling: Plugin error isolation, circuit breaking, configurable timeouts.
  • Example plugins: Content policy, audit logging, token budget enforcement, and generative slot profiling.

Review plan

  • Review spec for completeness against current Mellea internals
  • Validate hook trigger points map to actual code paths
  • Gather team feedback on hook surface area (too many? too few? missing categories?)

@araujof araujof marked this pull request as draft February 5, 2026 01:23
@mergify
Copy link

mergify bot commented Feb 5, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🔴 Enforce conventional commit

This rule is failing.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
…esign drifts

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
…onal suggestions by maintainers

Signed-off-by: Frederico Araujo <frederico.araujo@ibm.com>
@araujof araujof force-pushed the feat/hooks_specification branch from 5f5adeb to 0aee2a0 Compare February 5, 2026 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant