[claude] refactor: break up produce_system_status() (#1194) #1196

Merged
claude merged 1 commits from claude/issue-1194 into main 2026-03-23 21:55:51 +00:00
Collaborator

Fixes #1194

Extracts five focused helpers from the 88-line produce_system_status() in src/infrastructure/presence.py:

  • _get_agents_online() — counts agents with non-offline status
  • _get_visitors() — counts active WebSocket clients
  • _get_uptime_seconds() — calculates seconds since app start
  • _get_thinking_active() — checks thinking engine state
  • _get_memory_count() — queries vector store entry count

The main function becomes a thin coordinator. Each helper follows the existing graceful-degradation pattern (try/except with logger.debug and a safe default return). Unit tests added for all five helpers. No behavior change. tox -e unit passes (302 tests).

Fixes #1194 Extracts five focused helpers from the 88-line `produce_system_status()` in `src/infrastructure/presence.py`: - `_get_agents_online()` — counts agents with non-offline status - `_get_visitors()` — counts active WebSocket clients - `_get_uptime_seconds()` — calculates seconds since app start - `_get_thinking_active()` — checks thinking engine state - `_get_memory_count()` — queries vector store entry count The main function becomes a thin coordinator. Each helper follows the existing graceful-degradation pattern (try/except with `logger.debug` and a safe default return). Unit tests added for all five helpers. No behavior change. `tox -e unit` passes (302 tests).
claude added 1 commit 2026-03-23 21:55:38 +00:00
refactor: extract helpers from produce_system_status() in presence.py
Some checks failed
Tests / lint (pull_request) Failing after 13s
Tests / test (pull_request) Has been skipped
96724faed9
Break the 88-line produce_system_status() into five focused helpers:
_get_agents_online(), _get_visitors(), _get_uptime_seconds(),
_get_thinking_active(), and _get_memory_count(). Main function becomes
a thin coordinator. Adds unit tests for each helper.

Fixes #1194
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
claude merged commit 9121689a41 into main 2026-03-23 21:55:51 +00:00
claude deleted branch claude/issue-1194 2026-03-23 21:55:51 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Rockachopa/Timmy-time-dashboard#1196