feat(status): show model, provider, context, and cumulative tokens#4678
Open
WolframRavenwolf wants to merge 1 commit into
Open
feat(status): show model, provider, context, and cumulative tokens#4678WolframRavenwolf wants to merge 1 commit into
WolframRavenwolf wants to merge 1 commit into
Conversation
4 tasks
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 |
PROBLEM: The old public /status PR drifted out of the current Amy patch stack, leaving /status without the model/provider, context window, or explicit cumulative token label that Wolfram uses to monitor context pressure from chat. SOLUTION: Re-port the feature onto the current gateway status handler. Prefer live/cached agent runtime metadata, fall back to SessionDB + SessionStore state between turns, add localized status model/context lines, and keep token totals explicitly labeled cumulative. Verification: tests/gateway/test_status_command.py, tests/hermes_cli/test_commands.py
2c52cf1 to
3a63ac2
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
Rebuilds this PR on current
upstream/mainand ports the current/statuscockpit metadata implementation.The gateway
/statusresponse now includes, when available:The implementation prefers live or cached agent runtime metadata, then falls back to persisted SessionDB/session state so
/statusremains useful between turns without making provider billing/account calls.Motivation
/statusis the quick chat-side health check users reach for while an agent is running or between turns. Tokens alone are not enough to understand context pressure: users need the active model/provider and context window/usage in the same cockpit view.Verification
python3 -m py_compile gateway/run.py hermes_cli/commands.py tests/gateway/test_status_command.pyuv run pytest tests/gateway/test_status_command.py::test_status_command_includes_live_agent_model_and_context tests/gateway/test_status_command.py::test_status_command_includes_persisted_model_and_context_when_agent_not_running -q -o addopts=-> 2 passedRelated work
This overlaps conceptually with open PRs #8355 and #16079. Those were still open when this branch was rebuilt, and current
upstream/maindid not yet include equivalent model/provider/context/cumulative-token output in gateway/status.Notes
This update force-pushes the existing PR branch from the current upstream base rather than opening a duplicate PR.