Skip to content

Add Cursor agent usage collector - #6604

Closed
rlimberger wants to merge 6 commits into
omacom:quattrofrom
rlimberger:feat/agent-usage-cursor
Closed

rlimberger wants to merge 6 commits into
omacom:quattrofrom
rlimberger:feat/agent-usage-cursor

Conversation

@rlimberger

@rlimberger rlimberger commented Aug 7, 2026 •

Copy link
Copy Markdown

Summary

  • Add bin/omarchy-agent-usage-cursor, which reads Cursor's local state.vscdb (read-only) and maps GetCurrentPeriodUsage plan pools onto the agents record contract (limits[] for Cursor Models / Other Models, hasLocalStats: false)
  • Drop Cursor marks into shell/plugins/agents/assets/ so the panel discovers them by convention
  • Panel polish for meters-only agents: hoist shared LIMITS "Resets in …" when every meter shares one resetsAt, and gate day/model charts on hasLocalStats
  • Document + default-enable cursor alongside Claude/Codex

Builds on #6603. Supersedes #6591.

Test plan

  • bash test/shell.d/agent-usage-cursor-scanner-test.sh
  • bash test/shell.d/agent-usage-update-test.sh
  • Live: omarchy-agent-usage-cursor --force | jq . shows Cursor Models / Other Models + tier
  • Live: omarchy-agent-usage-update cursor writes ~/.local/state/omarchy/agents/usage/cursor.json
  • Manual: agents panel shows Cursor tab with meters only; shared LIMITS reset in header; no day/model charts
  • Manual: signed-out / missing Cursor stays self-hidden (collector returns non-ready record; tab omitted)
  • Manual: Claude session vs weekly still shows per-row resets (no shared LIMITS hoist)
  • Manual: visual check — LIMITS header + hoisted reset at panel width; no clipping/overlap (see agents/skills/visual-verification.md)

Made with Cursor

Copilot AI balanced review requested due to automatic review settings August 7, 2026 14:08

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

Adds Cursor usage collection and meters-only display support to the agents panel.

Changes:

  • Collects Cursor plan usage from its local credentials and usage API.
  • Adds Cursor branding and enables the provider by default.
  • Hides unavailable charts and consolidates shared reset times.

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 4 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
bin/omarchy-agent-usage-cursor Implements the Cursor collector.
test/shell.d/agent-usage-cursor-scanner-test.sh Tests credentials, mapping, validation, and API responses.
shell/plugins/agents/Panel.qml Supports meters-only agents and shared reset headers.
shell/plugins/agents/README.md Documents Cursor support and display behavior.
shell/plugins/agents/manifest.json Enables and describes Cursor.
shell/plugins/agents/assets/cursor.svg Adds the dark-surface Cursor mark.
shell/plugins/agents/assets/cursor-light.svg Adds the light-surface Cursor mark.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Ship Cursor as an omarchy-agent-usage-* collector that writes the shared
record contract (plan-pool meters, hasLocalStats false), plus panel polish
to hoist a shared LIMITS reset and hide charts for meters-only agents.

Co-authored-by: Cursor <[email protected]>
@rlimberger
rlimberger force-pushed the feat/agent-usage-cursor branch from a15454a to fa2db8a Compare August 10, 2026 07:55
Copilot AI review requested due to automatic review settings August 10, 2026 07:55

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

Copilot reviewed 4 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (1)

shell/plugins/agents/Panel.qml:642

  • The required running-UI verification for this layout change is still unchecked in the PR test plan. Before merging, verify the shared reset header and per-row fallback in the live panel, including narrow widths and both Cursor and Claude states; AGENTS.md:104-105 requires visual changes to be inspected for clipping, overlap, spacing, and regressions.
            Item {
              width: parent.width
              implicitHeight: Math.max(limitsHeaderLabel.implicitHeight, limitsHeaderResetText.implicitHeight)

              PanelSectionHeader {
                id: limitsHeaderLabel
                text: "LIMITS"
                foreground: root.foreground
                fontFamily: root.fontFamily
                anchors.left: parent.left
                anchors.verticalCenter: parent.verticalCenter
              }

              Text {
                id: limitsHeaderResetText
                visible: text !== ""
                text: root.limitsHeaderReset
                color: root.dim
                font.family: root.fontFamily
                font.pixelSize: Style.font.caption
                anchors.right: parent.right
                // Match the header glyphs, not the padded box centre.
                anchors.verticalCenter: limitsHeaderLabel.verticalCenter
                anchors.verticalCenterOffset: Math.round(limitsHeaderLabel.topPadding / 2)
              }

Give the hoisted reset countdown an explicit width and elide from the
left so LIMITS and "Resets in …" stay separated on narrow panels.

Co-authored-by: Cursor <[email protected]>
Copilot AI review requested due to automatic review settings August 10, 2026 08:10

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

Copilot reviewed 4 out of 7 changed files in this pull request and generated no new comments.

Map totalPercentUsed to an Included total meter and pass through Cursor's
displayMessage so the panel matches the in-app usage summary.

Co-authored-by: Cursor <[email protected]>
Copilot AI review requested due to automatic review settings August 10, 2026 08:49

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

Copilot reviewed 4 out of 7 changed files in this pull request and generated no new comments.

Cursor's displayMessage banner reads "You've hit your usage limit" even
when total usage is ~49%; feeding it into usageStatusText turned the
hero and status card red. Meters already carry the authoritative pools.

Co-authored-by: Cursor <[email protected]>
Copilot AI review requested due to automatic review settings August 10, 2026 09:11

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

Copilot reviewed 4 out of 7 changed files in this pull request and generated no new comments.

Suppressed comments (1)

shell/plugins/agents/README.md:25

  • This provider list is incomplete: a successful Fireworks collection sets hasLocalStats to true and emits recentDays, so the panel also displays this chart for Fireworks. Describing it as Claude/Codex-only makes the documented behavior disagree with the implementation.
  Shown only when the agent has local day history (Claude/Codex).

Fireworks also emits recentDays and modelUsage; the README should not
imply tokens-by-day is limited to Claude and Codex.

Co-authored-by: Cursor <[email protected]>
Copilot AI review requested due to automatic review settings August 10, 2026 09:56

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

Copilot reviewed 4 out of 7 changed files in this pull request and generated no new comments.

Read local Grok/pi/opencode session stats and the CLI billing endpoint into the same JSON the other agent scanners emit.
@bjarneo

bjarneo commented Sep 21, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #7087, which covers the same Cursor usage collector. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

@bjarneo bjarneo closed this Sep 21, 2026
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.

3 participants