
















@@ -428,6 +428,7 @@ describe("WhatsApp QA live runtime", () => {
428428"top-level-reply-shape",
429429"restart-resume",
430430"help-command",
431+"quote-reply",
431432"reaction-observation",
432433"allowlist-block",
433434]);
@@ -631,6 +632,8 @@ describe("WhatsApp QA live runtime", () => {
631632"whatsapp-top-level-reply-shape",
632633"whatsapp-restart-resume",
633634"whatsapp-help-command",
635+"whatsapp-reply-to-message",
636+"whatsapp-group-reply-to-message",
634637"whatsapp-status-reactions",
635638"whatsapp-group-allowlist-block",
636639];
@@ -656,6 +659,8 @@ describe("WhatsApp QA live runtime", () => {
656659"whatsapp-whoami-command",
657660"whatsapp-context-command",
658661"whatsapp-tool-only-usage-footer",
662+"whatsapp-reply-to-message",
663+"whatsapp-group-reply-to-message",
659664"whatsapp-reply-context-isolation",
660665"whatsapp-inbound-image-caption",
661666"whatsapp-audio-preflight",
@@ -677,6 +682,68 @@ describe("WhatsApp QA live runtime", () => {
677682]);
678683});
679684685+it("defines quote-reply scenarios for DM and group replies", () => {
686+const scenarios = testing.findScenarios([
687+"whatsapp-reply-to-message",
688+"whatsapp-group-reply-to-message",
689+]);
690+const runs = scenarios.map((scenario) => {
691+const run = scenario.buildRun();
692+if (run.kind === "approval" || !run.verify) {
693+throw new Error(`${scenario.id} unexpectedly built a non-message run`);
694+}
695+return { scenario, run };
696+});
697+698+expect(
699+runs.map(({ scenario, run }) => ({
700+id: scenario.id,
701+requiresGroupJid: scenario.requiresGroupJid,
702+standardId: scenario.standardId,
703+target: run.target,
704+})),
705+).toEqual([
706+{
707+id: "whatsapp-reply-to-message",
708+requiresGroupJid: undefined,
709+standardId: "quote-reply",
710+target: "dm",
711+},
712+{
713+id: "whatsapp-group-reply-to-message",
714+requiresGroupJid: true,
715+standardId: "quote-reply",
716+target: "group",
717+},
718+]);
719+expect(runs[0]?.run.input).not.toContain("openclawqa");
720+expect(runs[1]?.run.input).toMatch(/^openclawqa\b/u);
721+722+for (const { run } of runs) {
723+expect(() =>
724+run.verify?.(
725+{
726+kind: "text",
727+observedAt: "2026-06-05T01:00:01.000Z",
728+quoted: { messageId: "trigger-message-id" },
729+text: "reply",
730+},
731+{ sent: { messageId: "trigger-message-id" } } as never,
732+),
733+).not.toThrow();
734+expect(() =>
735+run.verify?.(
736+{
737+kind: "text",
738+observedAt: "2026-06-05T01:00:01.000Z",
739+text: "reply",
740+},
741+{ sent: { messageId: "trigger-message-id" } } as never,
742+),
743+).toThrow("expected reply quote trigger-message-id, got <missing>");
744+}
745+});
746+680747it("seeds the structured-message location check through text context", () => {
681748const [scenario] = testing.findScenarios(["whatsapp-inbound-structured-messages"]);
682749if (!scenario) {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。