Repository navigation
Feat: hooks system - #50
Conversation
✅ Deploy Preview for elph ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Important
Two issues in execute_hook deserve attention before merge: the hook subprocess environment is scrubbed to a handful of variables with no way to inject others (and this is undocumented), and a timed-out hook has only its direct child killed, leaving any grandchildren it spawned running. Both are detailed inline. The payload-shape inconsistency across events and the dead oversized-output cap are minor.
Reviewed changes
- WASM extension removal — deletes
elph-agent::plugins/*,elph-extension-pdk,ext-hello, theelph extensions/extCLI subcommand,SlashDispatch::Extension,resources.extensions/disabledExtensionssettings, and thewasmi/wat/walkdirdeps +extensionsCargo feature. All slash-command, palette, help, ACP-advertise, settings-schema, and doc surface updated to drop extension references. - Native lifecycle hook host (
crates/coding-agent/src/platform/hooks/mod.rs) —hooks.jsonconfig (home + trusted-project), jsonschema validation at load, 10 lifecycle events, per-hook timeout/matcher/env handling, andexecute_hookspawning the command with JSON stdin/stdout and fail-open error policy. - Harness wiring —
bind_to_harnessconsumes the pre-existing harness hooks (on_before_agent_start,on_tool_call,on_tool_result,on_session_before_compact,subscribe) so hooks can observe/modify agent turns, tool calls, compaction, and stop. Verifiedon_tool_callfires inbefore_tool_call(i.e. before approval/execution), so a hookblockgenuinely stops the tool. - Trust & doctor —
project_extensions_allowed→project_hooks_allowed; doctor reports hook load diagnostics and active-hook counts. - Docs & schema — new
docs/hooks.md,website/content/docs/start/hooks.md,schemas/hooks-schema.json, CHANGELOG/NOTICE/porting updates.
Verified the harness hook-registration APIs are pre-existing and unchanged; the diff only repurposes them, so the integration risk is low. The extension host was fully removed rather than left as a dual track, which is consistent with the docs.
DeepSeek Flash | 𝕏

Summary
Kind
Tested
Update
docs/in this PR if CLI, crate API, config, or user-visible behavior changed.