[kimi-task] [feat] Add system_status message producer #681

Closed
opened 2026-03-21 03:12:13 +00:00 by kimi · 1 comment
Collaborator

Epic: Matrix Unification

Task

Create produce_system_status() -> dict in src/infrastructure/presence.py that generates
a system_status message for the Matrix. This tells the frontend about system health.

Files

  • src/infrastructure/presence.py — add produce_system_status()
  • tests/unit/test_presence.py — add tests

Acceptance Criteria

  • Returns dict with type="system_status", data={agents_online, visitors, uptime_seconds, thinking_active, memory_count}
  • agents_online: count of agents with status != offline
  • visitors: count from VisitorRegistry
  • uptime_seconds: time since server start
  • thinking_active: bool from thinking engine state
  • memory_count: total memories in vector store
  • tox -e unit passes
  • tox -e lint passes

Context

The Matrix PROTOCOL.md specifies system_status but it was never implemented.
The Matrix style.css has an elaborate status panel (currently dead CSS) that will use this.

## Epic: Matrix Unification ## Task Create `produce_system_status() -> dict` in `src/infrastructure/presence.py` that generates a system_status message for the Matrix. This tells the frontend about system health. ## Files - src/infrastructure/presence.py — add produce_system_status() - tests/unit/test_presence.py — add tests ## Acceptance Criteria - [ ] Returns dict with type="system_status", data={agents_online, visitors, uptime_seconds, thinking_active, memory_count} - [ ] agents_online: count of agents with status != offline - [ ] visitors: count from VisitorRegistry - [ ] uptime_seconds: time since server start - [ ] thinking_active: bool from thinking engine state - [ ] memory_count: total memories in vector store - [ ] tox -e unit passes - [ ] tox -e lint passes ## Context The Matrix PROTOCOL.md specifies system_status but it was never implemented. The Matrix style.css has an elaborate status panel (currently dead CSS) that will use this.
kimi self-assigned this 2026-03-21 03:12:13 +00:00
Author
Collaborator

Task Complete

PR created: #743

What was implemented

produce_system_status() in src/infrastructure/presence.py generates system health messages for the Matrix with:

  • agents_online: Count of agents with status != offline
  • visitors: WebSocket client count
  • uptime_seconds: Server uptime
  • thinking_active: Thinking engine state
  • memory_count: Total memories in vector store

Design highlights

  • Graceful degradation: all data collection wrapped in try/except blocks
  • Never crashes even when dependencies fail
  • Follows existing Matrix protocol patterns

Tests

10 new test cases covering structure, types, error handling, and edge cases.

Verification

  • tox -e format (clean)
  • tox -e unit (2574 passed)
  • tox -e lint (clean)
  • tox -e pre-push (full CI suite)
## ✅ Task Complete PR created: [#743](http://143.198.27.163:3000/rockachopa/Timmy-time-dashboard/pulls/743) ### What was implemented **`produce_system_status()`** in `src/infrastructure/presence.py` generates system health messages for the Matrix with: - `agents_online`: Count of agents with status != offline - `visitors`: WebSocket client count - `uptime_seconds`: Server uptime - `thinking_active`: Thinking engine state - `memory_count`: Total memories in vector store ### Design highlights - Graceful degradation: all data collection wrapped in try/except blocks - Never crashes even when dependencies fail - Follows existing Matrix protocol patterns ### Tests 10 new test cases covering structure, types, error handling, and edge cases. ### Verification - ✅ tox -e format (clean) - ✅ tox -e unit (2574 passed) - ✅ tox -e lint (clean) - ✅ tox -e pre-push (full CI suite)
kimi closed this issue 2026-03-21 15:13:02 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#681