




















@@ -30,6 +30,7 @@ import {
3030buildLiveCronProbeMessage,
3131createLiveCronProbeSpec,
3232runOpenClawCliJson,
33+shouldRunLiveImageProbe,
3334} from "./live-agent-probes.js";
3435import { renderCatFacePngBase64 } from "./live-image-probe.js";
3536import { startGatewayServer } from "./server.js";
@@ -907,48 +908,57 @@ describeLive("gateway live (ACP bind)", () => {
907908expect(boundHistory.matchedAssistantText).toContain(`ACP-BIND-MEMORY-${memoryNonce}`);
908909logLiveStep("bound session transcript contains the final marker token");
909910910-const markerAssistantCount = assistantTexts.length;
911-let imageHistory: Awaited<ReturnType<typeof waitForAssistantTurn>> | null = null;
912-for (let attempt = 0; attempt < 2 && !imageHistory; attempt += 1) {
913-await sendChatAndWait({
914- client,
915-sessionKey: originalSessionKey,
916-idempotencyKey: `idem-image-${attempt}-${randomUUID()}`,
917-message:
918-"What animal is drawn in the attached image? Reply with only the lowercase animal name.",
919-originatingChannel: "slack",
920-originatingTo: conversationId,
921-originatingAccountId: accountId,
922-attachments: [
923-{
924-mimeType: "image/png",
925-fileName: `probe-${randomUUID()}.png`,
926-content: renderCatFacePngBase64(),
927-},
928-],
929-});
930-logLiveStep(`image turn completed (attempt ${String(attempt + 1)})`);
931-932-try {
933-imageHistory = await waitForAssistantTurn({
911+if (
912+shouldRunLiveImageProbe({
913+agent: liveAgent,
914+override: process.env.OPENCLAW_LIVE_ACP_BIND_IMAGE_PROBE,
915+})
916+) {
917+const markerAssistantCount = assistantTexts.length;
918+let imageHistory: Awaited<ReturnType<typeof waitForAssistantTurn>> | null = null;
919+for (let attempt = 0; attempt < 2 && !imageHistory; attempt += 1) {
920+await sendChatAndWait({
934921 client,
935-sessionKey: spawnedSessionKey,
936-minAssistantCount: markerAssistantCount + 1,
937-timeoutMs: liveAgent === "claude" ? 60_000 : 45_000,
922+sessionKey: originalSessionKey,
923+idempotencyKey: `idem-image-${attempt}-${randomUUID()}`,
924+message:
925+"What animal is drawn in the attached image? Reply with only the lowercase animal name.",
926+originatingChannel: "slack",
927+originatingTo: conversationId,
928+originatingAccountId: accountId,
929+attachments: [
930+{
931+mimeType: "image/png",
932+fileName: `probe-${randomUUID()}.png`,
933+content: renderCatFacePngBase64(),
934+},
935+],
938936});
939-} catch {
940-if (attempt === 1) {
941-logLiveStep(
942-"bound session image reply not observed; continuing to cron verification",
943-);
944-break;
937+logLiveStep(`image turn completed (attempt ${String(attempt + 1)})`);
938+939+try {
940+imageHistory = await waitForAssistantTurn({
941+ client,
942+sessionKey: spawnedSessionKey,
943+minAssistantCount: markerAssistantCount + 1,
944+timeoutMs: liveAgent === "claude" ? 60_000 : 45_000,
945+});
946+} catch {
947+if (attempt === 1) {
948+logLiveStep(
949+"bound session image reply not observed; continuing to cron verification",
950+);
951+break;
952+}
953+logLiveStep("bound session image reply not observed yet; retrying");
945954}
946-logLiveStep("bound session image reply not observed yet; retrying");
947955}
948-}
949-if (imageHistory) {
950-assertLiveImageProbeReply(imageHistory.lastAssistantText);
951-logLiveStep("bound session classified the probe image");
956+if (imageHistory) {
957+assertLiveImageProbeReply(imageHistory.lastAssistantText);
958+logLiveStep("bound session classified the probe image");
959+}
960+} else {
961+logLiveStep(`skipping image probe for ${liveAgent}`);
952962}
953963954964const requireCronMcpProbe = shouldRequireCronMcpProbe();
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。