Skip to content

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

refactor(debug): simplify queued image attachment roundtrip logic

Steven Enamakelbe3b6da89799
diff --git a/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs b/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
index e635ad0dc3..710dcc61dd 100644
--- a/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
+++ b/scripts/debug/web-scripts/queued-image-attachment-roundtrip.mjs
@@ -38,7 +38,6 @@ export default async function queuedImageAttachmentRoundtrip({
logDir,
}) {
const rpcCalls = [];
- const rpcResponses = [];
let rpcUrl;
let authorization;
page.on("request", async (request) => {
@@ -55,12 +54,6 @@ export default async function queuedImageAttachmentRoundtrip({
try {
const request = response.request();
const body = JSON.parse(request.postData() ?? "{}");
- if (body.method === "openhuman.channel_web_chat") {
- rpcResponses.push({
- params: body.params,
- response: unwrap(await response.json()),
- });
- }
} catch {}
});
@@ -136,6 +129,12 @@ export default async function queuedImageAttachmentRoundtrip({
if (!pending?.requestId || pending.message?.content !== QUEUED_PROMPT) {
throw new Error("accepted queued image did not remain as a pending follow-up");
}
+ const queuedAckCall = rpcCalls.find(
+ (call) =>
+ call.method === "openhuman.channel_web_chat" &&
+ call.params?.message === QUEUED_PROMPT,
+ );
+ if (!queuedAckCall) throw new Error("queued image did not use channel_web_chat");
if (
pending.attachments?.length !== 1 ||
pending.attachments[0]?.kind !== "image" ||