Skip to content

Commit 40e2828

Browse files
authored
Show plugin hooks in plugin details (#21447)
Supersedes the abandoned #19859, rebuilt on latest `main`. # Why PR #19705 adds discovery for hooks bundled with plugins, but `/plugins` still only shows skills, apps, and MCP servers. This follow-up makes bundled hooks visible in the same plugin detail view so users can inspect the full plugin surface in one place. We also need `PluginHookSummary` to populate Plugin Hooks in the app; `hooks/list` is not enough there because plugin detail needs to show hooks for disabled plugins too. # What - extend `plugin/read` with `PluginHookSummary` entries for bundled hooks - summarize plugin hooks while loading plugin details - render a `Hooks` row in the `/plugins` detail popup <img width="3456" height="848" alt="CleanShot 2026-04-27 at 11 45 34@2x" src="https://github.com/user-attachments/assets/fe3a38d6-a260-4351-8513-fb04c93d725b" />
1 parent 898f5bf commit 40e2828

23 files changed

Lines changed: 436 additions & 25 deletions

codex-rs/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/json/v2/PluginReadResponse.json

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/typescript/v2/PluginDetail.ts

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/typescript/v2/PluginHookSummary.ts

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/schema/typescript/v2/index.ts

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/app-server-protocol/src/protocol/v2/plugin.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,19 @@ pub struct PluginDetail {
552552
pub summary: PluginSummary,
553553
pub description: Option<String>,
554554
pub skills: Vec<SkillSummary>,
555+
pub hooks: Vec<PluginHookSummary>,
555556
pub apps: Vec<AppSummary>,
556557
pub mcp_servers: Vec<String>,
557558
}
558559

560+
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
561+
#[serde(rename_all = "camelCase")]
562+
#[ts(export_to = "v2/")]
563+
pub struct PluginHookSummary {
564+
pub key: String,
565+
pub event_name: HookEventName,
566+
}
567+
559568
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
560569
#[serde(rename_all = "camelCase")]
561570
#[ts(export_to = "v2/")]

codex-rs/app-server/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Example with notification opt-out:
208208
- `marketplace/remove` — remove a configured marketplace by name from the user marketplace config, and delete its installed marketplace root when one exists.
209209
- `marketplace/upgrade` — upgrade all configured Git plugin marketplaces, or one named marketplace when `marketplaceName` is provided. Returns selected marketplace names, upgraded roots, and per-marketplace errors.
210210
- `plugin/list` — list discovered plugin marketplaces and plugin state, including effective marketplace install/auth policy metadata, plugin `availability` (`AVAILABLE` by default or `DISABLED_BY_ADMIN` for remote plugins blocked upstream), fail-open `marketplaceLoadErrors` entries for marketplace files that could not be parsed or loaded, and best-effort `featuredPluginIds` for the official curated marketplace. `interface.category` uses the marketplace category when present; otherwise it falls back to the plugin manifest category (**under development; do not call from production clients yet**).
211-
- `plugin/read` — read one plugin by `marketplacePath` plus `pluginName`, returning marketplace info, a list-style `summary`, manifest descriptions/interface metadata, and bundled skills/apps/MCP server names. Returned plugin skills include their current `enabled` state after local config filtering. Plugin app summaries also include `needsAuth` when the server can determine connector accessibility (**under development; do not call from production clients yet**).
211+
- `plugin/read` — read one plugin by `marketplacePath` plus `pluginName`, returning marketplace info, a list-style `summary`, manifest descriptions/interface metadata, and bundled skills/hooks/apps/MCP server names. Returned plugin skills include their current `enabled` state after local config filtering; bundled hooks are returned as lightweight declaration summaries keyed for correlation with `hooks/list`. Plugin app summaries also include `needsAuth` when the server can determine connector accessibility (**under development; do not call from production clients yet**).
212212
- `plugin/skill/read` — read remote plugin skill markdown on demand by `remoteMarketplaceName`, `remotePluginId`, and `skillName`. This lets clients preview uninstalled remote plugin skills without downloading the plugin bundle.
213213
- `skills/changed` — notification emitted when watched local skill files change.
214214
- `app/list` — list available apps.

codex-rs/app-server/src/request_processors/plugins.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,15 @@ impl PluginRequestProcessor {
615615
&visible_skills,
616616
&outcome.plugin.disabled_skill_paths,
617617
),
618+
hooks: outcome
619+
.plugin
620+
.hooks
621+
.into_iter()
622+
.map(|hook| codex_app_server_protocol::PluginHookSummary {
623+
key: hook.key,
624+
event_name: hook.event_name.into(),
625+
})
626+
.collect(),
618627
apps: app_summaries,
619628
mcp_servers: outcome.plugin.mcp_server_names,
620629
}
@@ -1490,6 +1499,7 @@ fn remote_plugin_detail_to_info(
14901499
enabled: skill.enabled,
14911500
})
14921501
.collect(),
1502+
hooks: Vec::new(),
14931503
apps,
14941504
mcp_servers: Vec::new(),
14951505
}

0 commit comments

Comments
 (0)