@happycastle/oh-my-openclaw 0.21.0 → 0.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -105,10 +105,12 @@ export function registerSubagentTracker(api) {
105
105
  const wakeMessage = requesterSessionKey
106
106
  ? `[System] Sub-agent completed (runId=${runId}, requester=${requesterSessionKey}). Process the result and continue pending work.`
107
107
  : `[System] Sub-agent completed (runId=${runId}). Process the result and continue pending work.`;
108
- const targetSession = requesterSessionKey ?? callerSession;
109
- const result = await callHooksWake(wakeMessage, { gateway_url: config.gateway_url, hooks_token: config.hooks_token }, api.logger, targetSession ? { sessionKey: targetSession } : undefined);
108
+ // Use /hooks/wake to directly inject system event into the main session
109
+ // and trigger an immediate heartbeat. /hooks/agent creates a NEW isolated
110
+ // session which is not what we want — we need the main agent to wake up.
111
+ const result = await callHooksWake(wakeMessage, { gateway_url: config.gateway_url, hooks_token: config.hooks_token }, api.logger);
110
112
  if (result.ok) {
111
- api.logger.info(`${LOG_PREFIX} Wake sent from subagent_ended: runId=${runId}`);
113
+ api.logger.info(`${LOG_PREFIX} Wake triggered from subagent_ended: runId=${runId}`);
112
114
  }
113
115
  else {
114
116
  api.logger.warn(`${LOG_PREFIX} Wake from subagent_ended failed: ${result.error ?? `status ${result.status}`}`);
@@ -128,12 +130,12 @@ export function registerSubagentTracker(api) {
128
130
  const callerSession = getCallerSessionKey(matchedRunId);
129
131
  clearSubagentTracking(matchedRunId);
130
132
  api.logger.info(`${LOG_PREFIX} Sub-agent announce detected: runId=${matchedRunId} (callerSession=${callerSession ?? 'unknown'})`);
131
- // Send wake to ensure the main agent processes the announce and continues work
133
+ // Use /hooks/wake to directly inject into main session and trigger heartbeat
132
134
  const config = getConfig(api);
133
135
  if (config.webhook_bridge_enabled && config.gateway_url && config.hooks_token) {
134
- void callHooksWake(`[System] Sub-agent completed (runId=${matchedRunId}). Process the announce result and continue any pending work.`, { gateway_url: config.gateway_url, hooks_token: config.hooks_token }, api.logger, callerSession ? { sessionKey: callerSession } : undefined).then((result) => {
136
+ void callHooksWake(`[System] Sub-agent completed (runId=${matchedRunId}). Process the announce result and continue any pending work.`, { gateway_url: config.gateway_url, hooks_token: config.hooks_token }, api.logger).then((result) => {
135
137
  if (result.ok) {
136
- api.logger.info(`${LOG_PREFIX} Wake sent after sub-agent announce: runId=${matchedRunId}`);
138
+ api.logger.info(`${LOG_PREFIX} Wake triggered after sub-agent announce: runId=${matchedRunId}`);
137
139
  }
138
140
  else {
139
141
  api.logger.warn(`${LOG_PREFIX} Wake after announce failed: ${result.error ?? `status ${result.status}`}`);
@@ -2,7 +2,7 @@
2
2
  "id": "oh-my-openclaw",
3
3
  "name": "Oh-My-OpenClaw",
4
4
  "description": "Multi-agent orchestration plugin — 11 agents, category-based model routing, todo enforcer, ralph loop, agent setup CLI, and custom tools",
5
- "version": "0.21.0",
5
+ "version": "0.21.2",
6
6
  "skills": [
7
7
  "skills"
8
8
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happycastle/oh-my-openclaw",
3
- "version": "0.21.0",
3
+ "version": "0.21.2",
4
4
  "description": "Oh-My-OpenClaw plugin — multi-agent orchestration, todo enforcer, ralph loop, and custom tools for OpenClaw",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",