Skip to content

Load plugin hooks without other plugin capabilities#26272

Merged
charliemarsh-oai merged 2 commits into
mainfrom
charlie/hook-only-plugin-loader
Jun 4, 2026
Merged

Load plugin hooks without other plugin capabilities#26272
charliemarsh-oai merged 2 commits into
mainfrom
charlie/hook-only-plugin-loader

Conversation

@charliemarsh-oai

@charliemarsh-oai charliemarsh-oai commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

hooks/list only consumes plugin hook declarations, but previously loaded every enabled plugin's skills, MCP configuration, apps, and capability summary before discarding them.

In a local benchmark, this reduced hooks/list latency by over 100ms (e.g., from 594 to 467ms on startup, and 168 to 16ms when making a hooks/list call later in the same TUI session). This is on the critical path to rendering the TUI, so every 10s of ms should be eyed skeptically (IMO).

This change adds a hook-specific plugin loading path that preserves plugin enablement, remote/local conflict resolution, deterministic ordering, manifest resolution, and hook-loading warnings while skipping unrelated capabilities. (I think there's room for a more general design here that allows you to project the capabilities you need at load-time, but that seems unnecessary right now.)

@charliemarsh-oai charliemarsh-oai marked this pull request as ready for review June 4, 2026 01:49
@charliemarsh-oai charliemarsh-oai marked this pull request as draft June 4, 2026 01:53
@charliemarsh-oai charliemarsh-oai marked this pull request as ready for review June 4, 2026 01:54

@fcoury-oai fcoury-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good improvement here, thank you.

Smoke-tested hooks/list with an enabled plugin that had a valid hook plus intentionally malformed MCP/app configs; it returned the plugin hook and did not load or warn on the unrelated malformed capabilities.

Code also looks good, approved.

@charliemarsh-oai charliemarsh-oai merged commit 4ae7930 into main Jun 4, 2026
31 checks passed
@charliemarsh-oai charliemarsh-oai deleted the charlie/hook-only-plugin-loader branch June 4, 2026 15:21
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants