codeburn/tests/providers
Resham Joshi 810b214476
Cursor: per-project breakdown by workspace (closes per-project half of #196) (#296)
Cursor's chat history showed as a single row labeled 'cursor' in
the dashboard because the global state.vscdb has no workspace
field on individual bubbles. The fix joins through Cursor's
per-workspace storage:

1. Walk ~/Library/Application Support/Cursor/User/workspaceStorage/*
2. For each hash dir, read workspace.json -> folder URI
3. Open that dir's state.vscdb, read
   ItemTable['composer.composerData'] -> allComposers list
4. Build Map<composerId, folder URI>
5. emit one SessionSource per workspace plus a catch-all 'cursor'
   source for composers that did not register against any
   workspace (multi-root workspaces, no-folder-open windows,
   deleted workspaces with surviving global rows)

The parser decodes source.path's #cursor-ws= tag, filters the
parsed bubbles to the composerIds that belong to this workspace,
and yields only those. The orphan-tag source negates the filter so
it captures every composer not in any workspace.

In passing, fix a real bug in the old code: parseBubbles set
`sessionId: row.conversation_id ?? 'unknown'`, but the JSON
`conversationId` field is empty in current Cursor builds, so every
call shipped with `sessionId: 'unknown'`. We now derive the
composer id from the row key (`bubbleId:<composerId>:<bubbleUuid>`)
which is what the workspace map joins on. The old behavior masked
the bug because every call went into a single 'cursor' project
anyway; with per-workspace bucketing the bug becomes load-bearing.
Cache version bumped 2 -> 3 to invalidate caches that still record
'unknown' as the session id.

Live-tested against my real 1.9 GB Cursor DB: the single 'cursor'
row with 1904 calls / $4.08 now breaks into 5 workspaces plus an
orphan bucket, totals reconcile exactly. 8 fixture-based tests
cover multi-workspace routing, orphan filtering, legacy bare DB
path backwards compat, multi-root workspace skip, vscode-remote
URI slugification, and total reconciliation across all sources.

Full suite: 46 files, 653 tests passing.
2026-05-10 15:35:57 -07:00
..
claude-config-dirs.test.ts Support CLAUDE_CONFIG_DIRS for scanning multiple Claude data dirs (#208) (#288) 2026-05-09 22:04:45 -07:00
codex.test.ts Menubar and CLI hardening from multi-agent audit (#257) 2026-05-06 22:15:11 -07:00
copilot.test.ts Menubar and CLI hardening from multi-agent audit (#257) 2026-05-06 22:15:11 -07:00
crush.test.ts Add Crush provider plus per-provider icon column in README (#286) 2026-05-09 20:47:56 -07:00
cursor-agent.test.ts Add new providers, fix menubar tabs, accent color picker (#167) 2026-04-27 19:46:30 -07:00
cursor-bubble-dedup.test.ts Menubar and CLI hardening from multi-agent audit (#257) 2026-05-06 22:15:11 -07:00
cursor-workspace-breakdown.test.ts Cursor: per-project breakdown by workspace (closes per-project half of #196) (#296) 2026-05-10 15:35:57 -07:00
cursor.test.ts Add new providers, fix menubar tabs, accent color picker (#167) 2026-04-27 19:46:30 -07:00
droid.test.ts Add Droid CLI provider 2026-04-28 20:16:45 +02:00
kilo-code.test.ts Add OpenClaw, Roo Code, and KiloCode providers (#175) 2026-04-28 09:24:14 -07:00
kiro.test.ts Add new providers, fix menubar tabs, accent color picker (#167) 2026-04-27 19:46:30 -07:00
omp.test.ts Merge main into feat/omp-support-model-aliases 2026-04-21 03:16:28 -07:00
openclaw.test.ts Add OpenClaw, Roo Code, and KiloCode providers (#175) 2026-04-28 09:24:14 -07:00
opencode.test.ts fix: drop better-sqlite3 to remove deprecated prebuild-install (#75) 2026-04-18 01:26:23 -07:00
pi.test.ts perf: cache provider discovery metadata 2026-04-21 00:03:49 +02:00
roo-code.test.ts Add OpenClaw, Roo Code, and KiloCode providers (#175) 2026-04-28 09:24:14 -07:00