feat(status): rich /status snapshots across CLI and gateway - #8355
feat(status): rich /status snapshots across CLI and gateway#8355malaiwah wants to merge 2 commits into
Conversation
fb700c4 to
8636758
Compare
|
Thanks for the comprehensive status-snapshot work. The token regression and the gateway model/provider/context portion have since landed on main, but compression history and the broader snapshot remain useful. Problems
Suggested changes
Automated hermes-sweeper review. |
Retargeted from gateway/run.py to current code paths on main HEAD 91937a6. - Added hermes_cli/status_format.py with shared snapshot formatting helpers - Added compression_count + last_compressed_at to SessionEntry (session.py) - Added get_session_token_totals() and get_session_last_compressed() to hermes_state.py - Wired compression_count + last_compressed_at into agent_result dicts (gateway/run.py) - Added last_compressed_at timestamp to context_compressor.py (satisfies NousResearch#7317) - Added localization strings for rich snapshot fields (locales/en.yaml) - Preserved async DB access and t(...) localization conventions
8636758 to
31c1fc5
Compare
Retargeted to current main HEADThe original branch targeted the pre-refactor New file —
SessionEntry changes (
Database layer (
Agent result wiring (
Compression timestamp (
Localization (
Ready for re-review. |
The retargeted /status snapshot (PR NousResearch#8355) added 19 new keys to locales/en.yaml under gateway.status but did not add them to the other 16 locale files. This caused test_catalog_keys_match_english and test_catalog_placeholders_match_english to fail for all non-English locales in CI (slice 3/8). This commit copies the English strings as fallback values into all 16 locale files. Translators can update these at their leisure — the i18n test only verifies key presence and placeholder parity, not translation quality. Closes the CI failure on slice 3/8.
CI fix pushedSlice 3/8 was failing on Both failing tests enforce locale parity:
Fix: Copied the 19 English strings as fallback values into all 16 locale files ( Verified locally: All 36 i18n tests pass ( CI should go green on the next run. |
Summary
Replaces the basic
/statusoutput with a comprehensive session snapshot showing model, provider, token breakdown, cost, context window, and more.context_compressorwhen agent is running; idle fallback viaget_model_context_lengthwhen agent is idle (inspired by feat(status): show model, provider, context, and cumulative tokens #4678)compression_countfor idle sessions — idle sessions now show compression history instead of omitting itFixes #5960 (Tokens: 0 regression — reads from SessionDB instead of stale SessionStore).
Closes #7317 (context/compression state in gateway-visible status).
Closes #7714 (usage display like OpenClaw).
Supersedes #4678 (model + context in /status — this PR is a strict superset).
Supersedes #5989 (
get_session_token_totals— included here plus much more).Changes
hermes_cli/status_format.pyhermes_state.pyget_session_token_totals()andget_session_last_active()gateway/run.py_build_status_snapshot(),_get_status_platform_sections(),_get_status_queue_depth(); replace_handle_status_command(); persistcompression_countafter each turngateway/session.pycompression_countfield toSessionEntry, wire throughto_dict/from_dict/update_sessionrun_agent.pycompression_countfromrun_conversation()result dictcli.py_build_cli_status_snapshot(),_get_cli_status_queue_depth(); replace_show_session_status()tests/hermes_cli/test_status_format.pytests/gateway/test_status_command.pytests/cli/test_cli_status_command.pyExample output
Gateway (Telegram/Discord) — live agent:
Gateway — idle session (compression history persisted):
Design decisions
hermes_cli/status_format.pyholds all formatting logic. Both CLI and gateway import from it.get_model_context_length()+session_entry.last_prompt_tokensfor context, andsession_entry.compression_countfor compaction history. Both are persisted viaupdate_session()after each turn.compression_countdefaults to 0 inSessionEntry.from_dict(), so existingsessions.jsonfiles load cleanly.getattr()with defaults for optional runner attributes (_pending_hidden_turns,_agent_cache, etc.).Test plan
pytest tests/cli/test_cli_status_command.py tests/gateway/test_status_command.py tests/hermes_cli/test_status_format.py— 42 tests passcompression_count=3onSessionEntry🤖 Generated with Claude Code