Conversation
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/shared/collector.js # src/shared/hubBuildRegistry.json # worker/src/shared/hubBuildRegistry.json
Keep the opt-in Cursor per-device usage path while taking upstream through v0.60.0, including the Cursor legacy-session fix. The hub build registry records the combined clientHealth source list. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueComment |
This branch has not been deployed
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.
Summary
tokscale cursor sync,避免和账号总量叠算对应 希望 Cursor 用量也能按设备显示(多设备 Hub 目前会把同一账号加总) #698。先开草案,等 issue 方向确认后再转 Ready。
Test plan
npm run verifySummary by cubic
Adds an opt-in per-device Cursor usage mode that records Agent stop hooks into a machine-local jsonl, so a Hub no longer sums the same account CSV on every device. Default remains account-level CSV.
Summary
cursorUsageSourcesetting (accountdefault |device), exposed as the Settings → Cursor "Count Cursor usage on this device only" checkbox and theTOKEN_MONITOR_CURSOR_USAGE_SOURCEenv var.stop/subagentStophook into~/.cursor/hooks/and appends token counts to<sharedDataDir>/cursor-device/usage.jsonl, overridable viaTOKEN_MONITOR_CURSOR_DEVICE_LOG.tokscale cursor syncand treats Cursor as a runtime-local adapter, so account totals are not double-counted; limits stay account-scoped.input_tokensare split so cache read/write is not double-counted bytokenValue().tokscale cursor synctokscale cursor syncis skippedTests and risks
npm run verifypasses.中文版本
新增可選的按裝置 Cursor 用量模式,透過 Agent 的停止掛鉤(stop hook)將用量記錄到本機 jsonl,令 Hub 不再於每部裝置上累加同一份帳號 CSV。預設仍為帳號層級 CSV。
摘要
cursorUsageSource設定(預設account|device),可透過「設定 → Cursor」的「僅統計本機 Cursor 用量」選項或TOKEN_MONITOR_CURSOR_USAGE_SOURCE環境變數啟用。stop/subagentStop掛鉤安裝至~/.cursor/hooks/,並將 Token 用量附加至<sharedDataDir>/cursor-device/usage.jsonl(可用TOKEN_MONITOR_CURSOR_DEVICE_LOG覆寫)。tokscale cursor sync,並將 Cursor 視為執行期本機介面卡,避免與帳號總量重複計算;額度仍按帳號統計。tokenValue()重複計算快取讀取/寫入。tokscale cursor sync取得帳號層級 CSVtokscale cursor sync測試與風險
npm run verify通過。Written for commit 840e3d3. Summary will update on new commits.