fix: route agent CLI via gateway

This commit is contained in:
Peter Steinberger
2026-01-06 03:30:27 +01:00
parent e5e8ed4aef
commit 9623bd7763
5 changed files with 342 additions and 9 deletions

View File

@@ -598,12 +598,14 @@ export async function agentCommand(
2,
),
);
if (!deliver) return;
if (!deliver) {
return { payloads: normalizedPayloads, meta: result.meta };
}
}
if (payloads.length === 0) {
runtime.log("No reply from agent.");
return;
return { payloads: [], meta: result.meta };
}
const deliveryTextLimit =
@@ -787,4 +789,11 @@ export async function agentCommand(
}
}
}
const normalizedPayloads = payloads.map((p) => ({
text: p.text ?? "",
mediaUrl: p.mediaUrl ?? null,
mediaUrls: p.mediaUrls ?? (p.mediaUrl ? [p.mediaUrl] : undefined),
}));
return { payloads: normalizedPayloads, meta: result.meta };
}