From 58bce828bf145d00dc97dafc5cde0b9480585aa5 Mon Sep 17 00:00:00 2001 From: William Turner Date: Sun, 23 Aug 2026 11:42:48 +0000 Subject: [PATCH] =?UTF-8?q?Drop=20getUserId()=20call=20in=20Matrix=20bot?= =?UTF-8?q?=20startup=20=E2=80=94=20its=20whoami=20request=20404s=20agains?= =?UTF-8?q?t=20Continuwuity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not actually needed: self-message filtering was only used to avoid the bot reacting to its own replies, but those never match the !claude command pattern anyway, so parseCommand() already filters them out for free. --- agent/src/matrixBot.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/agent/src/matrixBot.js b/agent/src/matrixBot.js index c7d138c..21c2cfa 100644 --- a/agent/src/matrixBot.js +++ b/agent/src/matrixBot.js @@ -24,13 +24,13 @@ export async function startMatrixBot() { const client = new MatrixClient(HOMESERVER_URL, ACCESS_TOKEN, storage); AutojoinRoomsMixin.setupOnClient(client); - const selfUserId = await client.getUserId(); - client.on("room.message", async (roomId, event) => { - // Invite-only control room enforces who can reach the bot at all; this just - // scopes command handling to that one room and ignores the bot's own messages. + // Invite-only control room enforces who can reach the bot at all; this just scopes + // command handling to that one room. No need to fetch/compare the bot's own user ID + // to filter out its own messages — its replies ("Working on it...", "Opened PR:...", + // "Failed:...") never match the !claude command pattern below, so they're ignored + // by parseCommand() returning null, same as any other non-command message. if (roomId !== CONTROL_ROOM_ID) return; - if (event.sender === selfUserId) return; const body = event.content?.body; if (!body) return;