


































@@ -93,11 +93,16 @@ function extractAssistantTexts(messages: unknown[]): string[] {
9393.filter((value): value is string => typeof value === "string" && value.trim().length > 0);
9494}
959596-function createAcpRecallPrompt(liveAgent: LiveAcpAgent): string {
96+function createAcpRecallPrompt(
97+liveAgent: LiveAcpAgent,
98+followupToken: string,
99+recallNonce: string,
100+): string {
101+const recallToken = `ACP-BIND-RECALL-${recallNonce}`;
97102if (liveAgent !== "claude") {
98-return "Please include the exact token from your immediately previous assistant reply.";
103+return `Please include exactly these two tokens in your reply: ${followupToken} ${recallToken}.`;
99104}
100-return "Reply with exactly the token from your immediately previous assistant reply and nothing else.";
105+return `Reply with exactly these two tokens and nothing else: ${followupToken} ${recallToken}`;
101106}
102107103108function createAcpMarkerPrompt(liveAgent: LiveAcpAgent, memoryNonce: string): string {
@@ -449,6 +454,7 @@ describeLive("gateway live (ACP bind)", () => {
449454const conversationId = `user:${slackUserId}`;
450455const accountId = "default";
451456const followupNonce = randomBytes(4).toString("hex").toUpperCase();
457+const recallNonce = randomBytes(4).toString("hex").toUpperCase();
452458const memoryNonce = randomBytes(4).toString("hex").toUpperCase();
453459454460clearRuntimeConfigSnapshot();
@@ -606,7 +612,7 @@ describeLive("gateway live (ACP bind)", () => {
606612 client,
607613sessionKey: originalSessionKey,
608614idempotencyKey: `idem-memory-${attempt}-${randomUUID()}`,
609-message: createAcpRecallPrompt(liveAgent),
615+message: createAcpRecallPrompt(liveAgent, followupToken, recallNonce),
610616originatingChannel: "slack",
611617originatingTo: conversationId,
612618originatingAccountId: accountId,
@@ -660,6 +666,7 @@ describeLive("gateway live (ACP bind)", () => {
660666const recallAssistantText = recallHistory.matchedAssistantText;
661667if (liveAgent === "claude") {
662668expect(recallAssistantText).toContain(followupToken);
669+expect(recallAssistantText).toContain(`ACP-BIND-RECALL-${recallNonce}`);
663670}
664671logLiveStep("bound session transcript retained the previous token");
665672const recallAssistantCount = extractAssistantTexts(recallHistory.messages).length;
@@ -708,8 +715,7 @@ describeLive("gateway live (ACP bind)", () => {
708715sessionKey: originalSessionKey,
709716idempotencyKey: `idem-image-${attempt}-${randomUUID()}`,
710717message:
711-"Read the large word printed at the bottom of the attached image. " +
712-"Reply with that word in lowercase and nothing else.",
718+"What animal is drawn in the attached image? Reply with only the lowercase animal name.",
713719originatingChannel: "slack",
714720originatingTo: conversationId,
715721originatingAccountId: accountId,
@@ -745,9 +751,6 @@ describeLive("gateway live (ACP bind)", () => {
745751logLiveStep("bound session classified the probe image");
746752}
747753748-const imageAssistantCount = imageHistory
749- ? extractAssistantTexts(imageHistory.messages).length
750- : markerAssistantCount;
751754const cronProbe = createLiveCronProbeSpec({
752755agentId: liveAgent,
753756sessionKey: spawnedSessionKey,
@@ -771,13 +774,13 @@ describeLive("gateway live (ACP bind)", () => {
771774});
772775logLiveStep(`cron mcp turn completed (attempt ${String(attempt + 1)})`);
773776774-let cronHistory: Awaited<ReturnType<typeof waitForAssistantTurn>> | null = null;
777+let cronHistory: Awaited<ReturnType<typeof waitForAssistantText>> | null = null;
775778try {
776-cronHistory = await waitForAssistantTurn({
779+cronHistory = await waitForAssistantText({
777780 client,
778781sessionKey: spawnedSessionKey,
779-minAssistantCount: imageAssistantCount + 1,
780782timeoutMs: liveAgent === "claude" ? 90_000 : 45_000,
783+contains: cronProbe.name,
781784});
782785} catch {
783786logLiveStep("cron assistant reply not observed yet; relying on CLI verification");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。