Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(debug): improve message extraction in roundtrip script

Steven Enamakel483a17b41d44
diff --git a/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs b/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
index 0d3d743f03..618d579cc4 100644
--- a/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
+++ b/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
@@ -273,7 +273,11 @@ export default async function queuedImageAttachmentRoundtrip({
const body = await response.json();
if (!response.ok) throw new Error(`thread list failed with HTTP ${response.status}`);
if (body.error) throw new Error(`thread list RPC failed: ${JSON.stringify(body.error)}`);
- const messages = body.result?.messages ?? body.messages;
+ const messages =
+ body.result?.data?.messages ??
+ body.result?.messages ??
+ body.data?.messages ??
+ body.messages;
if (!Array.isArray(messages)) {
throw new Error(`thread list response has no messages: ${JSON.stringify(body)}`);
}
@@ -327,7 +331,11 @@ export default async function queuedImageAttachmentRoundtrip({
const body = await response.json();
if (!response.ok) throw new Error(`thread list failed with HTTP ${response.status}`);
if (body.error) throw new Error(`thread list RPC failed: ${JSON.stringify(body.error)}`);
- const messages = body.result?.messages ?? body.messages;
+ const messages =
+ body.result?.data?.messages ??
+ body.result?.messages ??
+ body.data?.messages ??
+ body.messages;
if (!Array.isArray(messages)) {
throw new Error(`thread list response has no messages: ${JSON.stringify(body)}`);
}