feat(04-02): add matrix context management commands

- add save/load/reset/context handlers and matrix interception flows
- persist current session and last token usage in prototype state
This commit is contained in:
Mikhail Putilovskij 2026-04-17 16:12:03 +03:00
parent da0b76882e
commit b52fdc4670
7 changed files with 638 additions and 21 deletions

View file

@ -132,3 +132,14 @@ async def test_set_last_tokens_used_persists_value():
await store.set_last_tokens_used("usr-matrix-@alice:example.org", 321)
assert await store.get_last_tokens_used("usr-matrix-@alice:example.org") == 321
@pytest.mark.asyncio
async def test_current_session_roundtrip():
store = PrototypeStateStore()
assert await store.get_current_session("usr-matrix-@alice:example.org") is None
await store.set_current_session("usr-matrix-@alice:example.org", "session-1")
assert await store.get_current_session("usr-matrix-@alice:example.org") == "session-1"