fix: imessage dm replies and error details (#935)

This commit is contained in:
Peter Steinberger
2026-01-15 07:58:44 +00:00
parent 9c04a79c0a
commit a5a9788b20
7 changed files with 88 additions and 6 deletions

View File

@@ -100,4 +100,36 @@ describe("runMessageAction context isolation", () => {
}),
).rejects.toThrow(/Cross-context messaging denied/);
});
it("allows iMessage send when target matches current handle", async () => {
const result = await runMessageAction({
cfg: whatsappConfig,
action: "send",
params: {
channel: "imessage",
to: "imessage:+15551234567",
message: "hi",
},
toolContext: { currentChannelId: "imessage:+15551234567" },
dryRun: true,
});
expect(result.kind).toBe("send");
});
it("blocks iMessage send when target differs from current handle", async () => {
await expect(
runMessageAction({
cfg: whatsappConfig,
action: "send",
params: {
channel: "imessage",
to: "imessage:+15551230000",
message: "hi",
},
toolContext: { currentChannelId: "imessage:+15551234567" },
dryRun: true,
}),
).rejects.toThrow(/Cross-context messaging denied/);
});
});