perf(cursor): stop tracing the per-event account usage hash#31017
Cursor usage scans hash every billed event (accountUsage.ts: page-overlap keys and per-event identity keys), and accountHash was a traced Effect.fn, so every hash exported its own span. In the last 24 h the dev servers on fs-42/43 ran 14 readCursorAccountUsage scans and exported 53,724 accountHash spans, about 3,800 per scan and 2,442 per instance-hour. That made it the most frequent span on those hosts, ahead of ScheduledTaskService.runDueTasks (824/h). Each span is ~0 ms of work, so the cost is pure tracing overhead and telemetry volume on every machine whose user has Cursor signed in.
accountHash is now Effect.fnUntraced, with a one-line reason, as AGENTS.md asks for per-item loops (same approach as #29758 for the live coalescer). The scan stays visible through readCursorAccountUsage and CursorAccountUsage.readPage. Behavior is unchanged, so there is no new test. The existing Cursor usage tests pass under vp run check:changed.
Opus 5.5 via Claude Code (T3 Code daily performance check-in).
π€ Generated with Claude Code
Checks
Added 1 commit
- perf(cursor): stop tracing the per-event account usage hash0aa4282
Approvability
Verdict: Approved at 0aa4282
Macroscope's review found this PR approvable β Removes per-hash tracing overhead from Cursor usage scans while preserving scan and page tracing. Hashing and usage-record behavior remain unchanged, so the impact is limited to internal telemetry.
You can add or adjust custom eligibility rules. Learn more.
No actionable comments were generated in the recent review.
Walkthrough
accountHashnow usesEffect.fnUntracedinstead of the namedEffect.fn("accountHash")wrapper. Its input and hashing behavior remain unchanged.Changes: Account hashing
Layer / File(s) Summary Update the accountHash wrapper
packages/provider-cursor/src/server/accountUsage.tsaccountHashusesEffect.fnUntraced. Its input and hashing implementation remain unchanged.Estimated code review effort: 1 (Trivial) | ~2 minutes
Change: Refactor
Suggested labels:
size:XSSuggested reviewers:
serhiyhvala,macroscopeapp
Merge Risk: External image Minimal Β· up to 0aa42
No actionable merge-blocking risk was identified.
Pre-merge checks: Passed 4
Check name Status Explanation Title check Passed The title clearly and concisely describes the main change: disabling tracing for the per-event Cursor account usage hash. Description check Passed The description explains the tracing overhead, the code change, the preserved scan-level tracing, the absence of behavior changes, and the verification performed. It also gives a focused rationale for⦠Linked Issues check Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request. Full details: Description check
Explanation
The description explains the tracing overhead, the code change, the preserved scan-level tracing, the absence of behavior changes, and the verification performed. It also gives a focused rationale for this small fix, although it does not use the template headings explicitly.
Finishing Touches
Generate docstrings
- Commit to this branch
- Create a new PR
Generate unit tests (beta)
- Commit to this branch
- Create a new PR
- Autofix Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info
-
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: perf/cursor-account-hash-untraced
- File: .coderabbit.config.ts
- Commit: 0aa4282
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
ced24864-c639-4862-af5f-5434c6a41f63
External image Commits
Reviewing files that changed from the base of the PR and between 9e85538535c8553901351112ab02dd1dd62db5ee and 0aa4282a731f45e8ac912d0a840791fd419159b3.
External image Files selected for processing: 1
packages/provider-cursor/src/server/accountUsage.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
External image Recent review info
-
External image Run configuration
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: perf/cursor-account-hash-untraced
- File: .coderabbit.config.ts
- Commit: 0aa4282
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Team
- Run ID:
ced24864-c639-4862-af5f-5434c6a41f63
External image Commits
Reviewing files that changed from the base of the PR and between 9e85538535c8553901351112ab02dd1dd62db5ee and 0aa4282a731f45e8ac912d0a840791fd419159b3.
External image Files selected for processing: 1
packages/provider-cursor/src/server/accountUsage.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
Thread transfer impact
β Thread transfer remains within every enforced ceiling.
| Provider | Metric | Main baseline | This PR | Impact | PR ceiling | |
|---|---|---|---|---|---|---|
| Codex | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | β |
| Codex | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | β |
| Codex | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | β |
| Codex | Live turn WebSocket decoded | 21.5 KiB | 21.5 KiB | 0 B (0.0%) | 24.4 KiB | β |
| Codex | Live turn messages | 1 | 1 | 0 (0.0%) | 8 | β |
| Claude | Total thread wire | 5.0 KiB | 5.0 KiB | 0 B (0.0%) | 6.8 KiB | β |
| Claude | Thread snapshot wire | 3.8 KiB | 3.8 KiB | 0 B (0.0%) | 4.9 KiB | β |
| Claude | Live turn WebSocket wire | 1.2 KiB | 1.2 KiB | 0 B (0.0%) | 2.0 KiB | β |
| Claude | Live turn WebSocket decoded | 21.9 KiB | 21.9 KiB | 0 B (0.0%) | 24.4 KiB | β |
| Claude | Live turn messages | 1 | 1 | 0 (0.0%) | 8 | β |
Baseline: 9e85538 Β· PR result: 0aa4282 Β· Source CI: success
Scenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.