fix(media): reject account-only route conflicts

This commit is contained in:
Peter Steinberger
2026-06-22 09:28:10 -07:00
committed by Ayaan Zaidi
parent 253180a265
commit 908a71ab57
2 changed files with 11 additions and 1 deletions
@@ -482,6 +482,17 @@ describe("createMediaGenerationTaskLifecycle", () => {
to: undefined,
accountId: "bot-a",
});
const accountOnlyHandle = lifecycle.createTaskRun({
sessionKey: "agent:main:telegram:shared",
requesterOrigin: { accountId: "bot-a" },
prompt: "account-only proof image",
});
expect(accountOnlyHandle?.requesterOrigin).toEqual({
channel: undefined,
to: undefined,
accountId: "bot-a",
});
});
it("returns the completion wake delivery result", async () => {
@@ -70,7 +70,6 @@ function resolvePinnedMediaRequesterOrigin(params: {
const requesterOrigin = normalizeDeliveryContext(params.requesterOrigin);
const sessionOrigin = normalizeDeliveryContext(params.sessionOrigin);
const accountsConflict =
requesterOrigin?.channel === sessionOrigin?.channel &&
requesterOrigin?.accountId &&
sessionOrigin?.accountId &&
requesterOrigin.accountId !== sessionOrigin.accountId;