Skip to content

Sort agents by total usage - #7861

Open
data-goblin wants to merge 2 commits into
basecamp:quattrofrom
data-goblin:feat/agents-sort-by-usage
Open

Sort agents by total usage#7861
data-goblin wants to merge 2 commits into
basecamp:quattrofrom
data-goblin:feat/agents-sort-by-usage

Conversation

@data-goblin

@data-goblin data-goblin commented Aug 23, 2026

Copy link
Copy Markdown

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:

Agents panel before the change, with Antigravity first

After — total usage:

Agents panel after the change, with Claude Code first

Changes

  • Sort agents by total token usage, falling back to prompts and provider name.
  • Add focused tests for the ordering and QML wiring.

Verification

  • bash test/shell.d/agents-panel-test.sh passes all 11 assertions.
  • qmllint shell/plugins/agents/Main.qml passes.

Thanks!


Disclaimer: The code in this PR was AI generated (Codex; GPT-5.6-sol max) and tested.

Copilot AI balanced review requested due to automatic review settings August 23, 2026 07:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread test/shell.d/agents-panel-test.sh
Disclaimer: The code in this commit was AI generated (Codex; GPT-5.6-sol max) and tested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants