Skip to content

Show Cursor plan usage in the Harness tab, and keep ACP turn token usage - #1464

Merged
dylanplayer merged 1 commit into
mainfrom
codevisor/huckleberry
Nov 23, 2026
Merged

dylanplayer merged 1 commit into
mainfrom
codevisor/huckleberry

Conversation

@dylanplayer

Copy link
Copy Markdown
Member

What changed

Cursor usage in the Harness tab

  • Cursor's adapter reads plan usage from Cursor's dashboard API (GetCurrentPeriodUsage, GetPlanInfo) using the login cursor-agent already stores: Keychain on macOS, auth.json on Linux and Windows.
  • The Harness tab shows the account, plan (for example "Ultra") and the included usage window ("Weekly usage", with reset time and pace). When Cursor reports Auto and API usage separately, each gets its own bar.
  • The Usage card now shows the plan for any harness that reports one.

ACP token usage

  • The generic ACP adapter keeps PromptResponse.usage instead of dropping it. The server adds each turn's tokens to the chat's stored totals.
  • ACP hasn't settled whether this field covers one turn or the whole session. We treat it as per turn, matching the field's own description.

Usage updates merge

  • The app merges usage updates into the current usage instead of replacing it, the same way the server stores them. A partial update no longer blanks the context reading.

Verification

  • In the dev app, a real Cursor chat's Harness tab shows Account, Plan: Ultra, and Weekly usage 1% with its reset time.
  • Tests: adapter-cursor (usage mapping, credential lookup), adapter-acp (turn usage emitted before the turn ends), server (turn tokens add up and keep the context reading), and Swift (usage updates merge).

Known, unrelated

  • On main, reopening a chat in the dev app shows a blank transcript even though the server returns its history. This happens with main's app code too.

🤖 Generated with Claude Code

Cursor's adapter now reads its plan usage from Cursor's dashboard API with
the login the CLI already stores (Keychain on macOS, auth.json elsewhere),
so the Harness tab shows its plan and weekly included usage instead of
nothing. The Usage card shows the plan for any harness that reports one.

The generic ACP adapter keeps the token usage an agent returns with a
prompt response; the server adds each turn to the chat's stored totals.
The app merges usage updates instead of replacing them, so a partial
update no longer blanks the context reading.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@dylanplayer
dylanplayer merged commit 5fd2f0c into main Nov 23, 2026
@dylanplayer
dylanplayer deleted the codevisor/huckleberry branch November 23, 2026 22:04
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.

1 participant