Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8db8347df0 | ||
|
|
34c2f7d634 | ||
|
|
fc53251285 |
@@ -31,3 +31,10 @@ jobs:
|
|||||||
IMAGE="${{ vars.REGISTRY_HOST }}/${{ gitea.repository }}/claude-agent:latest"
|
IMAGE="${{ vars.REGISTRY_HOST }}/${{ gitea.repository }}/claude-agent:latest"
|
||||||
docker build -t "$IMAGE" ./agent
|
docker build -t "$IMAGE" ./agent
|
||||||
docker push "$IMAGE"
|
docker push "$IMAGE"
|
||||||
|
|
||||||
|
- name: Trigger Portainer redeploy
|
||||||
|
# Deliberately NOT a separate Gitea repo webhook firing in parallel on the same
|
||||||
|
# push — that raced with this build and could redeploy before the new image was
|
||||||
|
# actually pushed, silently keeping the old code running. Chaining it here as the
|
||||||
|
# last step guarantees the image exists before Portainer goes to pull it.
|
||||||
|
run: curl -f -X POST "${{ secrets.PORTAINER_WEBHOOK_URL }}"
|
||||||
|
|||||||
+14
-2
@@ -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 { runChatTask } from "./runner.js";
|
||||||
import { askOpenRouter, DEFAULT_MODEL } from "./openrouter.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 storage = new SimpleFsStorageProvider("/workspace/matrix-bot-storage.json");
|
||||||
const client = new MatrixClient(HOMESERVER_URL, ACCESS_TOKEN, storage);
|
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) => {
|
client.on("room.message", async (roomId, event) => {
|
||||||
// Invite-only control room enforces who can reach the bot at all; this just scopes
|
// Invite-only control room enforces who can reach the bot at all; this just scopes
|
||||||
|
|||||||
Reference in New Issue
Block a user