feat: per-project Matrix room — load MATRIX_ROOM_ID from project TOML

Each project can specify its own Matrix room for notifications.
- harb → #harb-dev:matrix.allf.in
- disinto → #disinto-dev:matrix.allf.in
This commit is contained in:
openhands 2026-03-17 08:52:41 +00:00
parent 211ccb0445
commit ed57eff704
3 changed files with 25 additions and 0 deletions

View file

@ -54,6 +54,15 @@ svc = cfg.get('services', {})
if 'containers' in svc: if 'containers' in svc:
emit('PROJECT_CONTAINERS', svc['containers']) emit('PROJECT_CONTAINERS', svc['containers'])
# [matrix] section
mx = cfg.get('matrix', {})
if 'room_id' in mx:
emit('MATRIX_ROOM_ID', mx['room_id'])
if 'bot_user' in mx:
emit('MATRIX_BOT_USER', mx['bot_user'])
if 'token_env' in mx:
emit('MATRIX_TOKEN_ENV', mx['token_env'])
# [monitoring] section # [monitoring] section
mon = cfg.get('monitoring', {}) mon = cfg.get('monitoring', {})
for key in ['check_prs', 'check_dev_agent', 'check_pipeline_stall']: for key in ['check_prs', 'check_dev_agent', 'check_pipeline_stall']:
@ -80,4 +89,10 @@ if [ -z "${PROJECT_REPO_ROOT:-}" ] && [ -n "${PROJECT_NAME:-}" ]; then
export PROJECT_REPO_ROOT="/home/${USER}/${PROJECT_NAME}" export PROJECT_REPO_ROOT="/home/${USER}/${PROJECT_NAME}"
fi fi
# Resolve MATRIX_TOKEN from env var name (token_env points to an env var, not the token itself)
if [ -n "${MATRIX_TOKEN_ENV:-}" ]; then
export MATRIX_TOKEN="${!MATRIX_TOKEN_ENV:-}"
unset MATRIX_TOKEN_ENV
fi
unset _PROJECT_TOML _PROJECT_VARS _key _val unset _PROJECT_TOML _PROJECT_VARS _key _val

View file

@ -16,6 +16,11 @@ stale_minutes = 60
[services] [services]
containers = [] containers = []
[matrix]
room_id = "!ynKSMyWU7OSkbNjR:matrix.allf.in"
bot_user = "@disinto-factory:matrix.allf.in"
token_env = "DISINTO_MATRIX_TOKEN"
[monitoring] [monitoring]
check_prs = true check_prs = true
check_dev_agent = true check_dev_agent = true

View file

@ -14,6 +14,11 @@ stale_minutes = 60
[services] [services]
containers = ["ponder"] containers = ["ponder"]
[matrix]
room_id = "!LvLgiDVUbZKcRYga:matrix.allf.in"
bot_user = "@harb-factory:matrix.allf.in"
token_env = "MATRIX_TOKEN"
[monitoring] [monitoring]
check_prs = true check_prs = true
check_dev_agent = true check_dev_agent = true