openclaw-lark-multi-agent 1.8.7 → 1.8.8
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/openclaw-client.js +21 -2
- package/package.json +1 -1
package/dist/openclaw-client.js
CHANGED
|
@@ -1340,8 +1340,27 @@ export class OpenClawClient {
|
|
|
1340
1340
|
}
|
|
1341
1341
|
}
|
|
1342
1342
|
else if (toolName === "message" && (tphase === "end" || tphase === "error")) {
|
|
1343
|
-
|
|
1344
|
-
|
|
1343
|
+
// Top-level check ONLY: a read/reaction result whose content
|
|
1344
|
+
// merely mentions "terminate=true" (e.g. quoting this very
|
|
1345
|
+
// bug report in chat) must never be mistaken for a
|
|
1346
|
+
// terminating send.
|
|
1347
|
+
const rawOut = tdata.output ?? tdata.result ?? tdata.error ?? null;
|
|
1348
|
+
let terminating = false;
|
|
1349
|
+
try {
|
|
1350
|
+
if (rawOut && typeof rawOut === "object")
|
|
1351
|
+
terminating = rawOut.terminate === true;
|
|
1352
|
+
else if (typeof rawOut === "string") {
|
|
1353
|
+
const trimmed = rawOut.trim();
|
|
1354
|
+
if (trimmed.startsWith("{")) {
|
|
1355
|
+
const parsed = JSON.parse(trimmed);
|
|
1356
|
+
terminating = parsed && typeof parsed === "object" && parsed.terminate === true;
|
|
1357
|
+
}
|
|
1358
|
+
else
|
|
1359
|
+
terminating = /^terminate\s*=\s*true$/i.test(trimmed);
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
catch { /* unparseable output is not evidence */ }
|
|
1363
|
+
if (terminating && !terminatingSendTimer) {
|
|
1345
1364
|
terminatingSendTimer = setTimeout(() => {
|
|
1346
1365
|
terminatingSendTimer = null;
|
|
1347
1366
|
if (observationClosed)
|