Skip to content

Add Matrix sync state handling#27

Merged
mdheller merged 4 commits intomainfrom
work/matrix-sync-state
May 3, 2026
Merged

Add Matrix sync state handling#27
mdheller merged 4 commits intomainfrom
work/matrix-sync-state

Conversation

@mdheller
Copy link
Copy Markdown
Contributor

@mdheller mdheller commented May 3, 2026

Summary

Adds durable Matrix sync state handling and room resolution for AgentTerm Matrix workflows.

This PR adds:

  • matrix_state.py with MatrixSyncState, MatrixStateStore, room resolution, and room extraction from sync payloads.
  • agent-term-matrix --state option.
  • agent-term-matrix state command.
  • normalize-sync --save-state to persist next_batch and joined room IDs.
  • Room key/alias resolution for agent-term-matrix send using Matrix config and durable state.
  • Tests for Matrix state persistence, next-batch updates, room extraction, room resolution, config-driven send room resolution, state-saving sync normalization, and state display.

Boundary decisions

  • This is local durable sync state, not a live homeserver sync loop yet.
  • Matrix sends still route through dispatch and remain Policy Fabric-gated.
  • Sensitive sends remain E2EE posture-gated.
  • Access tokens still remain outside JSON config.
  • Live incremental /sync I/O remains a follow-up lane behind the Matrix service backend.

Validation

Expected CI:

ruff check .
pytest

Next lane after merge: live incremental Matrix sync command that uses stored next_batch and the optional matrix-nio backend.

@mdheller mdheller merged commit 6fc349b into main May 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant