@openagents-org/agent-launcher 0.2.20 → 0.2.21
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/package.json +1 -1
- package/src/adapters/openclaw.js +15 -4
package/package.json
CHANGED
package/src/adapters/openclaw.js
CHANGED
|
@@ -234,20 +234,31 @@ class OpenClawAdapter extends BaseAdapter {
|
|
|
234
234
|
memory_search: 'Searching memory...',
|
|
235
235
|
};
|
|
236
236
|
|
|
237
|
-
// Stream stderr in real-time to detect tool usage
|
|
237
|
+
// Stream stderr in real-time to detect tool usage and send status updates
|
|
238
|
+
let stderrBuffer = '';
|
|
238
239
|
if (proc.stdout) proc.stdout.on('data', (d) => { stdout += d; });
|
|
239
240
|
if (proc.stderr) proc.stderr.on('data', (d) => {
|
|
240
241
|
const chunk = d.toString();
|
|
241
242
|
stderr += chunk;
|
|
242
243
|
stdout += chunk;
|
|
244
|
+
stderrBuffer += chunk;
|
|
243
245
|
|
|
244
|
-
//
|
|
245
|
-
|
|
246
|
+
// Process complete lines
|
|
247
|
+
const lines = stderrBuffer.split('\n');
|
|
248
|
+
stderrBuffer = lines.pop() || ''; // keep incomplete last line
|
|
249
|
+
|
|
250
|
+
for (const line of lines) {
|
|
246
251
|
const toolStart = line.match(/embedded run tool start:.*tool=(\w+)/);
|
|
247
252
|
if (toolStart) {
|
|
248
253
|
const toolName = toolStart[1];
|
|
249
254
|
const label = toolLabels[toolName] || `Using ${toolName}...`;
|
|
250
|
-
|
|
255
|
+
this._log(`Tool status: ${label}`);
|
|
256
|
+
this.sendStatus(channel, label).catch(() => {});
|
|
257
|
+
}
|
|
258
|
+
// Also detect agent thinking
|
|
259
|
+
const agentStart = line.match(/embedded run agent start/);
|
|
260
|
+
if (agentStart) {
|
|
261
|
+
this.sendStatus(channel, 'thinking...').catch(() => {});
|
|
251
262
|
}
|
|
252
263
|
}
|
|
253
264
|
});
|