@happycastle/oh-my-openclaw 0.21.1 → 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.
- package/dist/hooks/subagent-tracker.js +11 -17
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LOG_PREFIX } from '../constants.js';
|
|
2
2
|
import { trackSubagentSpawn, clearSubagentTracking, getCallerSessionKey, getTrackedSubagents } from '../services/webhook-bridge.js';
|
|
3
|
-
import {
|
|
3
|
+
import { callHooksWake } from '../utils/webhook-client.js';
|
|
4
4
|
import { getConfig } from '../utils/config.js';
|
|
5
5
|
const SPAWN_TOOL_NAME = 'sessions_spawn';
|
|
6
6
|
function extractSpawnResult(content) {
|
|
@@ -105,17 +105,15 @@ 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
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
...(targetSession ? { sessionKey: targetSession } : {}),
|
|
113
|
-
}, api.logger);
|
|
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);
|
|
114
112
|
if (result.ok) {
|
|
115
|
-
api.logger.info(`${LOG_PREFIX}
|
|
113
|
+
api.logger.info(`${LOG_PREFIX} Wake triggered from subagent_ended: runId=${runId}`);
|
|
116
114
|
}
|
|
117
115
|
else {
|
|
118
|
-
api.logger.warn(`${LOG_PREFIX}
|
|
116
|
+
api.logger.warn(`${LOG_PREFIX} Wake from subagent_ended failed: ${result.error ?? `status ${result.status}`}`);
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
119
|
}, { priority: 120 });
|
|
@@ -132,19 +130,15 @@ export function registerSubagentTracker(api) {
|
|
|
132
130
|
const callerSession = getCallerSessionKey(matchedRunId);
|
|
133
131
|
clearSubagentTracking(matchedRunId);
|
|
134
132
|
api.logger.info(`${LOG_PREFIX} Sub-agent announce detected: runId=${matchedRunId} (callerSession=${callerSession ?? 'unknown'})`);
|
|
135
|
-
//
|
|
133
|
+
// Use /hooks/wake to directly inject into main session and trigger heartbeat
|
|
136
134
|
const config = getConfig(api);
|
|
137
135
|
if (config.webhook_bridge_enabled && config.gateway_url && config.hooks_token) {
|
|
138
|
-
void
|
|
139
|
-
name: 'OmOC-SubagentAnnounce',
|
|
140
|
-
deliver: false,
|
|
141
|
-
...(callerSession ? { sessionKey: callerSession } : {}),
|
|
142
|
-
}, api.logger).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) => {
|
|
143
137
|
if (result.ok) {
|
|
144
|
-
api.logger.info(`${LOG_PREFIX}
|
|
138
|
+
api.logger.info(`${LOG_PREFIX} Wake triggered after sub-agent announce: runId=${matchedRunId}`);
|
|
145
139
|
}
|
|
146
140
|
else {
|
|
147
|
-
api.logger.warn(`${LOG_PREFIX}
|
|
141
|
+
api.logger.warn(`${LOG_PREFIX} Wake after announce failed: ${result.error ?? `status ${result.status}`}`);
|
|
148
142
|
}
|
|
149
143
|
});
|
|
150
144
|
}
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.
|
|
5
|
+
"version": "0.21.2",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills"
|
|
8
8
|
],
|
package/package.json
CHANGED