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;