Files
Timmy-time-dashboard/tests/unit
kimi 6739ec0da8
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
feat: Add produce_system_status() for Matrix system health messages
Implements produce_system_status() in src/infrastructure/presence.py that
generates system_status messages for the Matrix frontend.

Features:
- agents_online: Count of agents with status != offline
- visitors: Count from WebSocket clients (_ws_clients)
- uptime_seconds: Time since APP_START_TIME
- thinking_active: Bool from thinking engine state and settings
- memory_count: Total memories from get_memory_stats()

All data collection uses graceful degradation (try/except blocks)
to ensure the function never crashes even when dependencies fail.

Includes comprehensive tests in tests/unit/test_presence.py covering:
- Message structure validation
- Data field types and non-negativity
- Graceful degradation on errors
- Timestamp format

Fixes #681
2026-03-21 11:10:39 -04:00
..