Skip to content

feat: add minimal plugin phase hook abstraction#12082

Closed
tomismeta wants to merge 5 commits intoopenclaw:mainfrom
tomismeta:codex/lifecycle-hooks-fresh
Closed

feat: add minimal plugin phase hook abstraction#12082
tomismeta wants to merge 5 commits intoopenclaw:mainfrom
tomismeta:codex/lifecycle-hooks-fresh

Conversation

@tomismeta
Copy link

@tomismeta tomismeta commented Feb 8, 2026

Superseded

This PR is closed and superseded.

Historical Context

This work originated from:

Why It Was Closed

  • raw runtime hooks are already exposed on main via api.on(...)
  • this branch kept drifting into unrelated conflicts and CI failures
  • the remaining value is documentation and discoverability, not a new abstraction layer

Recommended Follow-up

  • open a fresh docs-only PR from current main
  • document existing runtime hook accessibility via api.on(...)
  • document the available runtime hooks, where they fire, and recommended usage patterns

Relevant closing context is captured in the final maintainer-facing comment on this PR thread.

@openclaw-barnacle openclaw-barnacle bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling labels Feb 8, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch from c413739 to f0fbeea Compare February 9, 2026 03:07
@tomismeta tomismeta changed the title feat: implement plugin lifecycle interception architecture feat: implement plugin lifecycle interception hook architecture Feb 9, 2026
@tomismeta
Copy link
Author

I have this installed on a test VPS and it's operating cleanly.

I've also created a plugin that demonstrates the capability of the lifecycle interceptions hook architecture established in this PR so maintainers can see it in action without having to build their own proof of solution.

https://github.com/tomismeta/continuity-plugin

Please reach out to me if you have any questions or concerns.

@tomismeta
Copy link
Author

I acknowledge the scope is too large to be safely merged/implemented. Before I move forward with breaking the PR up, I wanted to get feedback from the maintainers:

  1. Does the way that I framed this architecture (API driven, aliases, hooks to events) align with the architecture/vision? I welcome any feedback?
  2. If it's aligned and I do pursue breaking it up, do you have any guidance on how I should approach it? There are two options I'm contemplating.

Option A: Grouped Event PRs (~5 PRs)

  • Foundation: lifecycle API, canonical/alias map, validation guards, no runtime wiring.
  • Message events: message_received, request_post, message_sending, message_sent, response_error.
  • Agent + recall: before_agent_start, agent_end, agent_error, before_recall, after_recall.
  • Tool + compaction: before_tool_call, after_tool_call, tool_error, before_compaction, after_compaction.
  • Gateway lifecycle + final hardening/docs: gateway_pre_start, gateway_start, gateway_pre_stop, gateway_stop.

Option B: Per-Event Micro PRs (~20 PRs)

  • One PR per runtime event (plus a small foundation PR first), e.g. message_received alone, then request_post, etc.
  • Each PR includes mapping, wiring, tests, and docs for only that event.

If this is already being implemented through other PRs (or not in alignment with the vision), let me know. Any and all feedback is welcome.

@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch 2 times, most recently from 01400e9 to 2a90634 Compare February 14, 2026 00:23
@openclaw-barnacle openclaw-barnacle bot added the commands Command implementations label Feb 14, 2026
@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch 4 times, most recently from bff4947 to 7dc25e5 Compare February 15, 2026 04:02
@openclaw-barnacle openclaw-barnacle bot added the channel: signal Channel integration: signal label Feb 15, 2026
@yursil
Copy link

yursil commented Feb 15, 2026

I really need this for my project to integrate with openclaw! let me know what I can do to help

@tomismeta
Copy link
Author

I really need this for my project to integrate with openclaw! let me know what I can do to help

Thanks for checking it out.

As for right now, just waiting on guidance from the maintainers to see if/how I should proceed with breaking this up as smaller PRs (the scope is too big/risky right now). If you have a maintainer contact, would love the plug to have them take a look.

That said, you can use this to build an OpenClaw installation (I've got another agent running on this PR) - would suggest you keep it separate from your primary OpenClaw instance. That said, I've had it up and running smoothly for about a week now with the Continuity plugin installed and working. Let me know if you install it and run into any issues.

@openclaw-barnacle
Copy link

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle bot added the stale Marked as stale due to inactivity label Feb 22, 2026
@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch from c8e0d13 to ce4ca3c Compare February 22, 2026 17:59
@openclaw-barnacle openclaw-barnacle bot removed the channel: signal Channel integration: signal label Feb 22, 2026
@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch 2 times, most recently from 07de69a to 0d1d057 Compare March 6, 2026 23:42
@tomismeta tomismeta changed the title feat: implement plugin lifecycle interception hook architecture feat: add plugin phase hook abstraction Mar 7, 2026
@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch from a9bb51a to df4a5eb Compare March 7, 2026 23:21
@openclaw-barnacle openclaw-barnacle bot added size: S and removed gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: XL labels Mar 7, 2026
@tomismeta tomismeta changed the title feat: add plugin phase hook abstraction feat: add minimal plugin phase hook abstraction Mar 7, 2026
@openclaw-barnacle openclaw-barnacle bot added channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram cli CLI command changes channel: feishu Channel integration: feishu size: M and removed size: S labels Mar 7, 2026
@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch from 6100985 to 7282a39 Compare March 7, 2026 23:56
@tomismeta tomismeta force-pushed the codex/lifecycle-hooks-fresh branch from 7282a39 to 0c2b657 Compare March 8, 2026 00:21
@openclaw-barnacle openclaw-barnacle bot removed channel: nextcloud-talk Channel integration: nextcloud-talk channel: telegram Channel integration: telegram cli CLI command changes channel: feishu Channel integration: feishu labels Mar 8, 2026
@tomismeta
Copy link
Author

Closing this PR as superseded.

Current state from the latest run on March 7, 2026 / March 8, 2026 UTC:

  • the branch is conflicting with main again, currently in src/node-host/invoke-system-run-plan.test.ts and src/node-host/invoke-system-run.test.ts
  • CI / check is failing on the plugin SDK import boundary lint (lint:plugins:no-monolithic-plugin-sdk-entry-imports), including extensions/feishu/src/directory.ts, extensions/nextcloud-talk/src/channel.ts, and extensions/telegram/src/channel.ts
  • CI / checks (node, protocol, pnpm protocol:check) is failing because generated protocol artifacts differ on the merge ref (apps/macos/Sources/OpenClawProtocol/GatewayModels.swift, AgentParams.workspaceDir)

More importantly, the branch no longer reflects the strongest justification for the work. Raw runtime hooks are already exposed on main via api.on(...), so the remaining value here is an abstraction layer, not first-time hook accessibility.

The better follow-up is a fresh docs-only PR from current main that documents:

  • existing runtime hook accessibility via api.on(...)
  • the available runtime hooks and where they fire
  • recommended hook choices for common plugin patterns

That is narrower, more accurate, and much more likely to merge cleanly.

@tomismeta tomismeta closed this Mar 8, 2026
@tomismeta tomismeta deleted the codex/lifecycle-hooks-fresh branch March 8, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: lobster Extension: lobster extensions: phone-control size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants