feat(status): rich /status snapshots across CLI and gateway#8355
Open
malaiwah wants to merge 1 commit into
Open
feat(status): rich /status snapshots across CLI and gateway#8355malaiwah wants to merge 1 commit into
malaiwah wants to merge 1 commit into
Conversation
This was referenced Apr 12, 2026
Open
Replace the basic /status output with a comprehensive session snapshot showing model, provider, token breakdown, cost, context window, and more. - Extract shared formatting helpers to hermes_cli/status_format.py - Add SessionDB.get_session_token_totals() — fixes Tokens: 0 (NousResearch#5960) - Add SessionDB.get_session_last_active() for relative timestamps - Idle context fallback via get_model_context_length (inspired by NousResearch#4678) - Persist compression_count in SessionEntry so idle sessions show compression history (NousResearch#7317) - 42 unit tests covering all code paths Closes NousResearch#7317, closes NousResearch#7714, supersedes NousResearch#4678 and NousResearch#5989. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fb700c4 to
8636758
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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