feat: implement OpenClaw integration#2607
Merged
code-yeongyu merged 2 commits intodevfrom Mar 16, 2026
Merged
Conversation
Ports the OMX OpenClaw module into oh-my-openagent as a first-class integration. This integration allows forwarding internal events (session lifecycle, tool execution) to external gateways (HTTP or command-based). - Added `src/openclaw` directory with implementation: - `dispatcher.ts`: Handles HTTP/Command dispatching with interpolation - `types.ts`: TypeScript definitions - `client.ts`: Main entry point `wakeOpenClaw` - `index.ts`: Public API - Added `src/config/schema/openclaw.ts` for Zod schema validation - Updated `src/config/schema/oh-my-opencode-config.ts` to include `openclaw` config - Added `src/hooks/openclaw-sender/index.ts` to listen for events - Registered the hook in `src/plugin/hooks/create-session-hooks.ts` - Added unit tests in `src/openclaw/__tests__` Events handled: - `session-start` (via `session.created`) - `session-end` (via `session.deleted`) - `session-idle` (via `session.idle`) - `ask-user-question` (via `tool.execute.before` for `ask_user_question`) - `stop` (via `tool.execute.before` for `stop-continuation` command)
There was a problem hiding this comment.
1 issue found across 14 files
Confidence score: 2/5
- There is a high-confidence compatibility bug in
src/hooks/openclaw-sender/index.ts:session.created/session.deletedcan carry the ID atproperties.info.id, but the hook only checksproperties.sessionID. - Because this affects session lifecycle events, it can prevent correct session tracking/deletion for Opencode agents, which is user-impacting behavior rather than a minor edge case.
- The issue is marked severe (8/10) with strong confidence (10/10), so this looks risky to merge without a fix.
- Pay close attention to
src/hooks/openclaw-sender/index.ts- session ID extraction forsession.createdandsession.deletedneeds to handleproperties.info.id.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/hooks/openclaw-sender/index.ts">
<violation number="1" location="src/hooks/openclaw-sender/index.ts:16">
P1: Custom agent: **Opencode Compatibility**
For `session.created` and `session.deleted` events, the session ID is located at `properties.info.id` rather than `properties.sessionID`. Without checking `info.id`, the hook will fall back to `getMainSessionID()` which may yield an incorrect ID for these events.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
Wow, I do believe this is what many users want: OpenClaw + Oh-my-OpenAgent. Looking for a stable feature and documentation for the integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: implement OpenClaw integration
Ports the OMX OpenClaw module into oh-my-openagent as a first-class integration.
This integration allows forwarding internal events (session lifecycle, tool execution) to external gateways (HTTP or command-based).
src/openclawdirectory with implementation:dispatcher.ts: Handles HTTP/Command dispatching with interpolationtypes.ts: TypeScript definitionsclient.ts: Main entry pointwakeOpenClawindex.ts: Public APIsrc/config/schema/openclaw.tsfor Zod schema validationsrc/config/schema/oh-my-opencode-config.tsto includeopenclawconfigsrc/hooks/openclaw-sender/index.tsto listen for eventssrc/plugin/hooks/create-session-hooks.tssrc/openclaw/__tests__Events handled:
session-start(viasession.created)session-end(viasession.deleted)session-idle(viasession.idle)ask-user-question(viatool.execute.beforeforask_user_question)stop(viatool.execute.beforeforstop-continuationcommand)Summary by cubic
Add OpenClaw integration to forward session and tool events to external gateways (HTTP or command). Also fixes session ID extraction by reading from event
properties.info.idfor reliablesession-start/session-endrouting.New Features
src/openclaw(client,dispatcher,types) withwakeOpenClaw, templated instructions, and non-blocking dispatch + tests.src/config/schema/openclaw.ts; wired intooh-my-opencode-config.ts; added and registeredopenclaw-senderin session and tool hooks.session-start,session-end,session-idle,ask-user-question,stop.OMX_OPENCLAW_COMMAND=1; shell-escaped vars; bounded timeouts).properties.info.idonsession.created/session.deleted.Migration
OMX_OPENCLAW=1to activate.openclawin plugin config withgatewaysandhooks.openclaw-senderhook.OMX_OPENCLAW_COMMAND=1(optionalOMX_OPENCLAW_COMMAND_TIMEOUT_MS).Written for commit 450685f. Summary will update on new commits.