open-agents-ai 0.187.188 → 0.187.189
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/index.js +9 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -317716,10 +317716,13 @@ function sanitizeChatContent(raw) {
|
|
|
317716
317716
|
for (const rawLine of lines) {
|
|
317717
317717
|
const line = rawLine.replace(/\x1B\[[0-9;]*[A-Za-z]/g, "").replace(/\x1B\].*?\x07/g, "").trim();
|
|
317718
317718
|
if (!line) continue;
|
|
317719
|
-
if (/^i\s
|
|
317720
|
-
if (/^E\s
|
|
317719
|
+
if (/^i\s+/.test(line)) continue;
|
|
317720
|
+
if (/^E\s+/.test(line)) continue;
|
|
317721
317721
|
if (/^⚠\s*(Task incomplete|Task complete)/.test(line)) continue;
|
|
317722
317722
|
if (/^▹\s/.test(line)) continue;
|
|
317723
|
+
if (/^User:\s/.test(line)) continue;
|
|
317724
|
+
if (/^Assistant:\s/.test(line)) continue;
|
|
317725
|
+
if (/^Previous conversation:/.test(line)) continue;
|
|
317723
317726
|
if (/^open-agents \(/.test(line)) continue;
|
|
317724
317727
|
cleaned.push(line);
|
|
317725
317728
|
}
|
|
@@ -319244,11 +319247,12 @@ ${historyLines}
|
|
|
319244
319247
|
const summaryMatch = summary.match(/Tokens:\s*[\d,]+\s+([\s\S]*)/);
|
|
319245
319248
|
content = sanitizeChatContent(summaryMatch ? summaryMatch[1] : summary);
|
|
319246
319249
|
}
|
|
319247
|
-
if (!
|
|
319248
|
-
|
|
319250
|
+
if (!backendError && parsed.text) {
|
|
319251
|
+
const m2 = String(parsed.text).match(/Backend (?:HTTP \d+|error):\s*[^\n]+/);
|
|
319252
|
+
if (m2) backendError = m2[0];
|
|
319249
319253
|
}
|
|
319250
319254
|
} catch {
|
|
319251
|
-
content =
|
|
319255
|
+
content = "";
|
|
319252
319256
|
}
|
|
319253
319257
|
const created = Math.floor(Date.now() / 1e3);
|
|
319254
319258
|
const id = `chatcmpl-${session.id.slice(0, 12)}`;
|
package/package.json
CHANGED