Compare commits

..
Author SHA1 Message Date
claude-agent bb9545cdc5 claude: update CONTRIBUTING.md to also mention that only PRs are allowed, never direct pushes or merges by the bot 2026-08-23 15:10:43 +00:00
william 34c2f7d634 Merge pull request 'Fix Matrix bot autojoin 404 on startup' (#5) from fix/matrix-autojoin-404 into main
build-agent / build-and-push (push) Successful in 10s
Reviewed-on: #5
2026-08-23 15:08:37 +00:00
william fc53251285 Replace AutojoinRoomsMixin with a lightweight invite handler
Same root cause as the earlier whoami fix: the mixin's initial
/joined_rooms scan 404s against Continuwuity even though the endpoint
works fine when called directly. Only auto-join-on-invite was actually
needed, so a plain room.invite listener replaces the whole mixin.
2026-08-23 15:06:57 +00:00
2 changed files with 22 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
# Contributing
- Changes land via pull request — no direct pushes to `main`. Branch protection enforces
this (see README.md, "Branch protection on `main`").
- This applies to the Claude bot too: it only ever opens PRs, never pushes or merges
directly. `claude-bot`'s account is deliberately excluded from the merge whitelist, so a
human always reviews and merges.
- Open a PR against `main` and wait for review before merging.
+14 -2
View File
@@ -1,4 +1,4 @@
import { MatrixClient, SimpleFsStorageProvider, AutojoinRoomsMixin } from "matrix-bot-sdk";
import { MatrixClient, SimpleFsStorageProvider } from "matrix-bot-sdk";
import { runChatTask } from "./runner.js";
import { askOpenRouter, DEFAULT_MODEL } from "./openrouter.js";
@@ -45,7 +45,19 @@ export async function startMatrixBot() {
const storage = new SimpleFsStorageProvider("/workspace/matrix-bot-storage.json");
const client = new MatrixClient(HOMESERVER_URL, ACCESS_TOKEN, storage);
AutojoinRoomsMixin.setupOnClient(client);
// Not using AutojoinRoomsMixin: it calls /joined_rooms at startup to build its initial
// state, which — like the /whoami call removed earlier — 404s against Continuwuity for
// reasons unrelated to the endpoint itself (curling it directly works fine). This
// simpler handler does the one thing we actually need — auto-join on invite — without
// that startup scan.
client.on("room.invite", async (roomId) => {
try {
await client.joinRoom(roomId);
} catch (err) {
console.error("failed to join invited room", roomId, err.message);
}
});
client.on("room.message", async (roomId, event) => {
// Invite-only control room enforces who can reach the bot at all; this just scopes