Skip to content

feat(hooks): config_change event — fires on /reload#230

Merged
emal-avala merged 1 commit intomainfrom
feat/hook-config-change-event
Apr 23, 2026
Merged

feat(hooks): config_change event — fires on /reload#230
emal-avala merged 1 commit intomainfrom
feat/hook-config-change-event

Conversation

@emal-avala
Copy link
Copy Markdown
Member

Summary

Adds a ConfigChange hook event that fires when on-disk extensions are reloaded via /reload. External dashboards, CI watchers, and alerting pipelines can now detect "a new skill file just landed" or "MCP server count dropped" without polling the filesystem.

Context payload

{
  "skill_count": 24,
  "agent_count": 3,
  "hook_count": 2,
  "mcp_count": 1
}

Wiring

  • HookEvent::ConfigChange variant with snake_case serde
  • fire_config_change_hooks(skill, agent, hook, mcp) async method on QueryEngine
  • /reload handler fires after the extension rescan + prompt-cache invalidation completes, using the existing block_on bridge (matches /compact, /cd, /add-dir precedents)
  • HOOK_EVENT_CATALOG, format_hook_event, parse_hook_event updated
  • hooks/mod.rs module docs updated

Test plan

  • cargo clippy --workspace --tests --no-deps -- -D warnings — clean
  • cargo test -p agent-code-lib --lib hooks::tests — 10 pass (9 prior + 1 new)
  • cargo test -p agent-code-lib --lib config::schema::tests::hook_event_serde_roundtrip_config_change — pass
  • cargo test -p agent-code --bin agent commands::tests::parse_hook_event — 11 pass (10 prior + 1 new)

3 new tests:

  1. Schema serde round-trip (config_change"config_change")
  2. run_hooks dispatches for ConfigChange
  3. parse_hook_event accepts "config_change" / "config-change"

Adds a `ConfigChange` hook event that fires when on-disk extensions
are reloaded via /reload. External dashboards, CI watchers, and
alerting pipelines can now detect "a new skill file just landed"
or "MCP server count dropped" without polling the filesystem.

Context payload:

  {
    "skill_count": 24,
    "agent_count": 3,
    "hook_count": 2,
    "mcp_count": 1
  }

Wiring:
- HookEvent::ConfigChange variant with snake_case serde
- fire_config_change_hooks(skill, agent, hook, mcp) async method
  on QueryEngine
- /reload handler fires after the extension rescan + prompt-cache
  invalidation completes, using the existing block_on bridge
  (matches /compact, /cd, /add-dir precedents)
- HOOK_EVENT_CATALOG, format_hook_event, parse_hook_event updated
- hooks/mod.rs module docs updated

Tests: 3 new
- Schema serde round-trip (config_change <-> "config_change")
- run_hooks dispatches for ConfigChange (async tokio)
- parse_hook_event accepts "config_change" / "config-change"
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@emal-avala emal-avala merged commit 687017d into main Apr 23, 2026
14 checks passed
@emal-avala emal-avala deleted the feat/hook-config-change-event branch April 23, 2026 22:35
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