fix(gateway): show context window and reasoning in /status - #64859
Open
bcarrillo11 wants to merge 1 commit into
Open
fix(gateway): show context window and reasoning in /status#64859bcarrillo11 wants to merge 1 commit into
bcarrillo11 wants to merge 1 commit into
Conversation
Resolve missing context totals from bounded model metadata lookups and display the effective session reasoning level. Add localized labels and regression coverage for success, timeout, failure, and invalid metadata paths.
teknium1
reviewed
Jul 16, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the focused gateway status improvement. Current main still lacks both the metadata fallback and reasoning display (gateway/slash_commands.py:602-606, 638-641).
Problems
gateway/slash_commands.py:664-667resolves reasoning withoutmodel=model_name. The shared resolver intentionally derives an omitted model fromconfig.model.defaultbefore applyingagent.reasoning_overrides(hermes_constants.py:970-995). Thus an inactive session whose effective/persisted model differs from the global default can display the wrong effort.
Suggested changes
- Pass
model=model_nameto_resolve_session_reasoning_config. - Add a no-resident-agent regression test where the status model differs from
config.model.defaultand each has a distinct per-model reasoning override.
The target files have not changed between the PR base and current main's parent; this is a focused salvage with a small correction. Automated hermes-sweeper review.
| if reasoning_config is None: | ||
| reasoning_config = self._resolve_session_reasoning_config( | ||
| source=source, | ||
| session_key=session_key, |
Contributor
There was a problem hiding this comment.
Pass model=model_name here. Without it, the shared resolver falls back to config.model.default before applying per-model overrides, so an inactive session on a different effective model can report the wrong reasoning effort.
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.
What does this PR do?
Improves the gateway
/statusresponse in two related ways:model.context_lengthprovides it.The metadata fallback is bounded to 3 seconds, handles lookup failures, validates that the result is a positive non-boolean integer, and gracefully falls back to the existing used-context-only line.
Example:
Why?
For gateway sessions without a resident agent and without an explicit
model.context_length,/statusshowed only the used token estimate even though Hermes can resolve the model's full context window through its metadata catalog. The command also did not expose the session's effective reasoning level, making session overrides hard to inspect.Related work
/contextcommand and also touchesgateway/slash_commands.py; this PR is intentionally limited to improving the existing/statusfallback and effective reasoning display.gateway/slash_commands.pyarchitecture, with an async metadata lookup bounded by a timeout./statuscommand.Type of change
Changes
gateway/slash_commands.pyget_model_context_length_async();asyncio.wait_for()and degrade safely;locales/*.yamlgateway.status.reasoningfor all 16 catalogs.tests/gateway/test_status_command.pyVerification
tests/gateway/test_status_command.py: 23 passedtests/agent/test_i18n.py: 47 passedgit diff --checkChecklist