Skip to content

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

chore(debug): update image attachment roundtrip script

Steven Enamakeleade879414ad
diff --git a/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs b/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
index 7d99e335a6..a570ba5f41 100644
--- a/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
+++ b/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
@@ -452,7 +452,9 @@ export default async function queuedImageAttachmentRoundtrip({
const imageRequest = mock
.requests()
.filter((request) => /(?:^|\/)chat\/completions(?:\?|$)/.test(request.url))
- .at(-1);
+ .findLast((request) =>
+ JSON.stringify(JSON.parse(request.body).messages ?? []).includes(QUEUED_PROMPT),
+ );
if (!imageRequest) throw new Error("queued turn did not reach the mock model");
const input = JSON.stringify(JSON.parse(imageRequest.body).messages ?? []);
if (/\[(?:ATTACHMENT|IMAGE|FILE|VOICE):/i.test(input)) {