fix: Remove Matrix integration — notifications move to forge + OpenClaw (#732)
Remove all Matrix/Dendrite infrastructure: - Delete lib/matrix_listener.sh (long-poll daemon), lib/matrix_listener.service (systemd unit), lib/hooks/on-stop-matrix.sh (response streaming hook) - Remove matrix_send() and matrix_send_ctx() from lib/env.sh - Remove MATRIX_HOMESERVER auto-detection, MATRIX_THREAD_MAP from lib/env.sh - Remove [matrix] section parsing from lib/load-project.sh - Remove Matrix hook installation from lib/agent-session.sh - Remove notify/notify_ctx helpers and Matrix thread tracking from dev/dev-agent.sh and action/action-agent.sh - Remove all matrix_send calls from dev-poll.sh, phase-handler.sh, action-poll.sh, vault-poll.sh, vault-fire.sh, vault-reject.sh, review-poll.sh, review-pr.sh, supervisor-poll.sh, formula-session.sh - Remove Matrix listener startup from docker/agents/entrypoint.sh - Remove append_dendrite_compose() and setup_matrix() from bin/disinto - Remove --matrix flag from disinto init - Clean Matrix references from .env.example, projects/*.toml.example, formulas/*.toml, AGENTS.md, BOOTSTRAP.md, README.md, RESOURCES.md, PHASE-PROTOCOL.md, and all agent AGENTS.md/PROMPT.md files Status visibility now via Codeberg PR/issue activity. Human interaction via vault items through forge. Proactive alerts via OpenClaw heartbeats. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7996bb6c06
commit
23949083c0
43 changed files with 73 additions and 1157 deletions
|
|
@ -1,45 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
# on-stop-matrix.sh — Stop hook: post Claude response to Matrix thread.
|
||||
#
|
||||
# Called by Claude Code after each assistant turn. Reads the response from
|
||||
# the hook JSON and posts it to the Matrix thread for this action session.
|
||||
#
|
||||
# Requires env vars: MATRIX_THREAD_ID, MATRIX_TOKEN, MATRIX_HOMESERVER, MATRIX_ROOM_ID
|
||||
#
|
||||
# Usage (in .claude/settings.json):
|
||||
# {"type": "command", "command": "/path/to/on-stop-matrix.sh"}
|
||||
|
||||
# Exit early if Matrix thread not configured
|
||||
if [ -z "${MATRIX_THREAD_ID:-}" ] || [ -z "${MATRIX_TOKEN:-}" ] \
|
||||
|| [ -z "${MATRIX_HOMESERVER:-}" ] || [ -z "${MATRIX_ROOM_ID:-}" ]; then
|
||||
cat > /dev/null
|
||||
exit 0
|
||||
fi
|
||||
|
||||
input=$(cat)
|
||||
|
||||
# Extract response text from hook JSON
|
||||
response=$(printf '%s' "$input" | jq -r '.last_assistant_message // empty' 2>/dev/null)
|
||||
[ -z "$response" ] && exit 0
|
||||
|
||||
# Truncate long output for readability (keep to ~4000 chars)
|
||||
MAX_LEN=4000
|
||||
if [ "${#response}" -gt "$MAX_LEN" ]; then
|
||||
response="${response:0:$MAX_LEN}
|
||||
... [truncated]"
|
||||
fi
|
||||
|
||||
# Post to Matrix thread
|
||||
room_encoded="${MATRIX_ROOM_ID//!/%21}"
|
||||
txn="$(date +%s%N)$$"
|
||||
|
||||
body=$(jq -nc \
|
||||
--arg m "$response" \
|
||||
--arg t "$MATRIX_THREAD_ID" \
|
||||
'{msgtype:"m.text",body:$m,"m.relates_to":{rel_type:"m.thread",event_id:$t}}')
|
||||
|
||||
curl -s -X PUT \
|
||||
-H "Authorization: Bearer ${MATRIX_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${MATRIX_HOMESERVER}/_matrix/client/v3/rooms/${room_encoded}/send/m.room.message/${txn}" \
|
||||
-d "$body" > /dev/null 2>&1 || true
|
||||
Loading…
Add table
Add a link
Reference in a new issue