






















@@ -12,6 +12,7 @@ vi.mock("../agent-scope.js", async () => {
1212};
1313});
141415+import { buildAgentPeerSessionKey } from "../../routing/session-key.js";
1516import { createCronTool } from "./cron-tool.js";
16171718describe("cron tool", () => {
@@ -823,6 +824,53 @@ describe("cron tool", () => {
823824});
824825});
825826827+it("does not surface lowercased LINE recipients when current delivery context is unavailable (#81628)", async () => {
828+// Reproduces openclaw/openclaw#81628. LINE chat IDs are case-sensitive — push
829+// requires capital C/U/R; lowercased recipients return HTTP 400. The runtime
830+// already lowercases LINE peer IDs when canonicalizing the session key, and
831+// when the delivery-recovery / post-reply-token-expiry push path is missing
832+// currentDeliveryContext, inferDeliveryFromSessionKey lifts the lowercased
833+// fragment straight into delivery.to.
834+const sessionKey = buildAgentPeerSessionKey({
835+agentId: "main",
836+channel: "line",
837+peerKind: "group",
838+peerId: "Cabcdef0123456789abcdef0123456789",
839+});
840+expect(sessionKey).toBe("agent:main:line:group:cabcdef0123456789abcdef0123456789");
841+842+const delivery = await executeAddAndReadDelivery({
843+callId: "call-line-group-no-context-81628",
844+agentSessionKey: sessionKey,
845+// Intentionally no currentDeliveryContext — emulates the delivery-recovery
846+// boundary that reloads queued entries from disk after the reply token has
847+// expired.
848+});
849+850+expect(delivery?.to).toBeUndefined();
851+});
852+853+it("does not surface lowercased LINE DM recipients with per-account-channel-peer scope (#81628)", async () => {
854+const sessionKey = buildAgentPeerSessionKey({
855+agentId: "main",
856+channel: "line",
857+peerKind: "direct",
858+accountId: "primary",
859+dmScope: "per-account-channel-peer",
860+peerId: "Uabcdef0123456789abcdef0123456789",
861+});
862+expect(sessionKey).toBe(
863+"agent:main:line:primary:direct:uabcdef0123456789abcdef0123456789",
864+);
865+866+const delivery = await executeAddAndReadDelivery({
867+callId: "call-line-direct-no-context-81628",
868+agentSessionKey: sessionKey,
869+});
870+871+expect(delivery?.to).toBeUndefined();
872+});
873+826874it("does not let current delivery context override explicit delivery targets", async () => {
827875expect(
828876await executeAddAndReadDelivery({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。