feat(status): show model, context usage, and cumulative label in /status#4678
Open
WolframRavenwolf wants to merge 1 commit into
Open
feat(status): show model, context usage, and cumulative label in /status#4678WolframRavenwolf wants to merge 1 commit into
WolframRavenwolf wants to merge 1 commit into
Conversation
Add Model line (from live agent or config fallback), Context line showing approximate current context usage vs model limit with percentage, and mark cumulative token count explicitly as '(cumulative)'. Context tokens come from the agent's last_prompt_tokens (live) or session_entry.last_prompt_tokens (idle). Context limit resolves from the agent's context_compressor or DEFAULT_CONTEXT_LENGTHS lookup. Inspired by OpenClaw's status format but kept simple and pragmatic.
4 tasks
malaiwah
pushed a commit
to malaiwah/hermes-agent
that referenced
this pull request
Apr 12, 2026
Replace the basic /status output with a comprehensive session snapshot showing model, provider, token breakdown (input/output/cache/reasoning), cost, context window usage with idle fallback, compression count, queue depth, and platform categorization. - 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) - 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>
3 tasks
Contributor
|
Nice work on the idle context fallback — PR #8355 incorporates the same idea (using |
malaiwah
pushed a commit
to malaiwah/hermes-agent
that referenced
this pull request
Apr 12, 2026
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>
malaiwah
pushed a commit
to malaiwah/hermes-agent
that referenced
this pull request
Apr 13, 2026
When no live agent is running, estimate the context window limit from model metadata (get_model_context_length) and show last_prompt_tokens as current usage. Inspired by upstream PR NousResearch#4678. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
Related to #16079 (also adds model/provider info to /status) — these likely overlap significantly. |
Collaborator
|
Related to #16079 |
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
Enhances the
/statusslash command in the gateway to display:Motivation
Users had no way to see which model was active or how much context was consumed without checking config files or logs. This information is critical for understanding agent behavior and knowing when context compression might kick in.
Changes
gateway/run.py: Enhanced
_handle_status_commandwith:context_compressor_resolve_gateway_model(), context from session entry +DEFAULT_CONTEXT_LENGTHSfuzzy lookupagent is not _AGENT_PENDING_SENTINEL) — pending agents now correctly report as "not running", consistent with_handle_stop_commandcontext_used=0(e.g., after/new) — onlycontext_totalis checked, avoiding the Python falsy-zero pitfallExample Output
Design Decisions
DEFAULT_CONTEXT_LENGTHS, context line is simply omitted rather than showing incorrect data_load_gateway_config()and_resolve_gateway_model()for the idle path, same as/modeland agent spawnTest Plan
agent.modelandagent.provider)/new(zero-context edge case)DEFAULT_CONTEXT_LENGTHS