[kimi] Add system_status message producer (#681) #743

Merged
kimi merged 1 commits from kimi/issue-681 into main 2026-03-21 15:13:01 +00:00

1 Commits

Author SHA1 Message Date
kimi
6739ec0da8 feat: Add produce_system_status() for Matrix system health messages
Some checks failed
Tests / lint (pull_request) Has been cancelled
Tests / test (pull_request) Has been cancelled
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