Session: split stable group ids from labels

This commit is contained in:
Gustavo Madeira Santana
2026-03-12 09:40:06 +00:00
parent 1c468315c3
commit ba9494a3a1
13 changed files with 79 additions and 23 deletions

View File

@@ -412,12 +412,14 @@ describe("matrix monitor handler pairing account scope", () => {
}),
);
expect(finalizeInboundContext).toHaveBeenCalledWith(
const finalized = vi.mocked(finalizeInboundContext).mock.calls.at(-1)?.[0];
expect(finalized).toEqual(
expect.objectContaining({
GroupSubject: "Ops Room",
GroupChannel: "!room:example.org",
GroupId: "!room:example.org",
}),
);
expect(finalized).not.toHaveProperty("GroupChannel");
});
it("routes bound Matrix threads to the target session key", async () => {

View File

@@ -630,7 +630,7 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
SenderId: senderId,
SenderUsername: senderId.split(":")[0]?.replace(/^@/, ""),
GroupSubject: isRoom ? (roomName ?? roomId) : undefined,
GroupChannel: isRoom ? roomId : undefined,
GroupId: isRoom ? roomId : undefined,
GroupSystemPrompt: isRoom ? groupSystemPrompt : undefined,
Provider: "matrix" as const,
Surface: "matrix" as const,