fix(plugin): dispatch openclaw lifecycle events from handlers

This commit is contained in:
GeonWoo Jeon (Jay)
2026-04-07 22:49:37 +09:00
parent 9491bede5b
commit 21ab1a6475
4 changed files with 283 additions and 10 deletions
+13
View File
@@ -6,6 +6,7 @@ import type {
} from "../agents/dynamic-agent-prompt-builder"
import type { OhMyOpenCodeConfig } from "../config"
import { isInteractiveBashEnabled } from "../create-runtime-tmux-config"
import * as openclawRuntimeDispatch from "../openclaw/runtime-dispatch"
import type { PluginContext, ToolsRecord } from "./types"
import {
@@ -158,6 +159,18 @@ export function createToolRegistry(args: {
},
},
})
if (pluginConfig.openclaw) {
await openclawRuntimeDispatch.dispatchOpenClawEvent({
config: pluginConfig.openclaw,
rawEvent: "session.created",
context: {
sessionId: event.sessionID,
projectPath: ctx.directory,
tmuxPaneId: managers.tmuxSessionManager.getTrackedPaneId?.(event.sessionID) ?? process.env.TMUX_PANE,
},
})
}
},
})