mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 09:40:30 +08:00
- Add _message_count and _last_activity_timestamp to orchestrator - Add record_activity() method to orchestrator - Add name field to get_protocol_status returns - Add total_messages and last_activity to get_stats - Update tests to verify new fields
1.4 KiB
1.4 KiB
Why
The RuntimeStatusStar was implemented based on a spec, but the implementation does not match the specification:
get_protocol_statusspec requires anamefield per protocol, but implementation only returnsconnectedget_statsspec requirestotal_messagesandlast_activityfields, but implementation only returnsuptime_seconds
This spec-implementation mismatch means external consumers cannot rely on the documented interface.
What Changes
- Update
get_protocol_statusto includenamefield for each protocol client (lsp, mcp, acp, abp) - Update
get_statsto returntotal_messagesandlast_activityas specified - Add message tracking infrastructure to the orchestrator to support
total_messagesandlast_activity - Update tests to verify spec compliance
Capabilities
Modified Capabilities
RuntimeStatusStar.get_protocol_status: Now returns{"lsp": {"connected": bool, "name": "lsp-client"}, ...}RuntimeStatusStar.get_stats: Now returns{"total_messages": int, "last_activity": str, "uptime_seconds": float}
New Infrastructure
- Orchestrator message tracking:
_message_countand_last_activity_timestamp
Impact
- Modifies:
astrbot/_internal/stars/runtime_status_star.py- add name fields and message stats - Modifies:
astrbot/_internal/runtime/orchestrator.py- add message tracking counters - Modifies:
tests/unit/test_runtime_status_star.py- update tests to verify spec compliance