Add detailed context usage indicator mode#397
Open
emil-e wants to merge 1 commit intoxenodium:mainfrom
Open
Conversation
Owner
|
Thanks for the PR. Could you please include a screenshot, so I get a visual idea in context? |
Contributor
Author
|
I noticed a bug when I was getting the screenshot, will get back with both a fix and a screenshot. |
Extend `agent-shell-show-context-usage-indicator` from a boolean to a three-way choice: nil (hidden), t (bar, existing default), or `detailed` which shows a numeric format like "➤ 29k/200k (29%)". The detailed indicator reuses the existing `agent-shell--format-number-compact` helper and the same color thresholds (success/warning/error at 60%/85%) as the bar indicator. The entire string except the ➤ prefix is propertized with the appropriate face for coherent coloring.
5be242d to
364d989
Compare
Contributor
Author
|
@xenodium There we go... I had forgotten about the text header, which proved a little tricky because it's actually a mode line. Fixed it now, and there are also screenshots. |
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.
Current context usage indicator in agent-shell is a small bar that only gives a rough estimate. There are other features to show more details, such as end-of-turn display and more. However, I and many others prefer to have a persistent display in the header, just with more details.
This PR adds the option to set
agent-shell-show-context-usage-indicatorto'detailed. This displays context usage in the form➤ 29k/200k (29%). Setting the variable totworks exactly like before.Solves #372
Checklist
M-x checkdocandM-x byte-compile-file.