Sort agents by total usage - #7861
Open
data-goblin wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Sorts agent tabs by all-time token usage so frequently used agents appear first.
Changes:
- Adds reusable usage-sorting logic with deterministic tie-breakers.
- Wires sorting into the agents panel and adds focused tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
shell/plugins/agents/AgentsModel.js |
Calculates total usage and sorts providers. |
shell/plugins/agents/Main.qml |
Applies usage ordering to enabled providers. |
test/shell.d/agents-panel-test.sh |
Tests token totals, ordering, and QML wiring. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Disclaimer: The code in this commit was AI generated (Codex; GPT-5.6-sol max) and tested.
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.
Motivation
Agents panel currently sorts alphabetically. This is less useful as when you click it, you have to click multiple times to get to your most-used agent if it's not starting first. I thought it'd make more sense to sort by total usage L-->R.
Before — alphabetical:
After — total usage:
Changes
Verification
bash test/shell.d/agents-panel-test.shpasses all 11 assertions.qmllint shell/plugins/agents/Main.qmlpasses.Thanks!
Disclaimer: The code in this PR was AI generated (Codex; GPT-5.6-sol max) and tested.