Skip to content

Feat: hooks system - #50

Merged
riipandi merged 3 commits into
mainfrom
feat/hooks-system
Aug 29, 2026
Merged

riipandi merged 3 commits into
mainfrom
feat/hooks-system

Conversation

@riipandi

Copy link
Copy Markdown
Owner

Summary

Kind

  • Bug fix
  • Feature
  • Docs
  • Other (CI / refactor / pi port)

Tested

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

@netlify

netlify Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for elph ready!

Name Link
🔨 Latest commit 23d8bba
🔍 Latest deploy log https://app.netlify.com/projects/elph/deploys/6a92f0347c86e10008978163
😎 Deploy Preview https://deploy-preview-50--elph.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@riipandi
riipandi merged commit 635e366 into main Aug 29, 2026
7 of 8 checks passed

@pullfrog pullfrog Bot 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.

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, the elph extensions/ext CLI subcommand, SlashDispatch::Extension, resources.extensions/disabledExtensions settings, and the wasmi/wat/walkdir deps + extensions Cargo 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.json config (home + trusted-project), jsonschema validation at load, 10 lifecycle events, per-hook timeout/matcher/env handling, and execute_hook spawning the command with JSON stdin/stdout and fail-open error policy.
  • Harness wiring — bind_to_harness consumes 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. Verified on_tool_call fires in before_tool_call (i.e. before approval/execution), so a hook block genuinely 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash | 𝕏

@riipandi
riipandi deleted the feat/hooks-system branch August 30, 2026 07: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