Skip to content

fix: invalidate Cursor cache after missing-createdAt fix#337

Open
lincolnwan wants to merge 1 commit into
getagentseal:mainfrom
lincolnwan:fix/invalidate-cursor-cache-after-missing-createdAt-fix
Open

fix: invalidate Cursor cache after missing-createdAt fix#337
lincolnwan wants to merge 1 commit into
getagentseal:mainfrom
lincolnwan:fix/invalidate-cursor-cache-after-missing-createdAt-fix

Conversation

@lincolnwan
Copy link
Copy Markdown

Summary

  • Bump Cursor result cache version from 3 to 4 so stale v3 caches are invalidated.
  • Respect CODEBURN_CACHE_DIR for Cursor result cache, matching docs and enabling isolated cache tests.
  • Add a regression test for old v3 Cursor caches created before the missing-createdAt fix.

Why

This follows up on fe2e622 ("Skip Cursor bubble rows that lack a createdAt timestamp") from PR #321; it invalidates caches generated before that parser fix.

That parser fix made fresh parsing skip Cursor bubble rows without createdAt, but existing ~/.cache/codeburn/cursor-results.json files could still contain v3 cached calls timestamped with parse time.

If the Cursor DB mtime/size did not change, CodeBurn would continue trusting that stale cache and still report phantom current-day usage.

Testing

  • npm test -- tests/cursor-cache.test.ts tests/providers/cursor.test.ts tests/providers/cursor-bubble-dedup.test.ts tests/providers/cursor-workspace-breakdown.test.ts
  • npx tsc --noEmit

Notes

This does not change Cursor parsing logic. It only invalidates previously poisoned Cursor result caches and adds coverage for that behavior.

@ozymandiashh
Copy link
Copy Markdown
Contributor

Validation run on macOS arm64. No local project names, paths, prompts, session IDs, costs, or usage details are included here.

Proof:

  • npx vitest run tests/cursor-cache.test.ts tests/providers/cursor.test.ts — 11/11 tests passed.
  • npm run build — passed.
  • git diff --check — passed.
  • Claude Opus 4.7 effort max review — PASS.
  • Gemini 3.1 Pro Preview review — PASS.

Read-only review notes:

  • The cache version bump from 3 to 4 invalidates stale Cursor result caches written before the missing-createdAt fix.
  • CODEBURN_CACHE_DIR is scoped to the cache helper and preserves default behavior when unset.
  • The new test isolates the cache path in a temp directory and restores the env var after each test.

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.

2 participants