Skip to content

fix(analytics): use lstat to skip broken symlinks in JSONL scan#515

Open
usubhash wants to merge 1 commit intodavila7:mainfrom
usubhash:main
Open

fix(analytics): use lstat to skip broken symlinks in JSONL scan#515
usubhash wants to merge 1 commit intodavila7:mainfrom
usubhash:main

Conversation

@usubhash
Copy link
Copy Markdown

@usubhash usubhash commented Apr 10, 2026

fs.stat() follows symlinks, so a broken symlink (e.g. ~/.claude/debug/latest pointing to a deleted file) throws ENOENT and aborts the entire conversation scan, causing the dashboard to show 0 conversations.

Switch to fs.lstat() + skip symlinks so the recursive JSONL finder is robust against broken links and any other unreadable entries in ~/.claude.

Fixes: dashboard shows "Found 0 conversations" on macOS when ~/.claude/debug/latest is a dangling symlink


Summary by cubic

Make the JSONL scan resilient to broken symlinks so analytics doesn’t abort and show 0 conversations. We now inspect entries with fs.lstat and skip symlinks and unreadable items.

  • Bug Fixes
    • Use fs.lstat and skip symlinks/unreadable entries in ConversationAnalyzer to prevent ENOENT aborts during scans.
    • Fixes "Found 0 conversations" when ~/.claude/debug/latest is a dangling symlink on macOS.
    • Area: CLI (cli-tool/src/).
    • No new components; no catalog (docs/components.json) change needed.
    • No new environment variables or secrets.

Written for commit c7f984c. Summary will update on new commits.

fs.stat() follows symlinks, so a broken symlink (e.g. ~/.claude/debug/latest
pointing to a deleted file) throws ENOENT and aborts the entire conversation
scan, causing the dashboard to show 0 conversations.

Switch to fs.lstat() + skip symlinks so the recursive JSONL finder is robust
against broken links and any other unreadable entries in ~/.claude.

Fixes: dashboard shows "Found 0 conversations" on macOS when ~/.claude/debug/latest is a dangling symlink
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 10, 2026

@usubhash is attempting to deploy a commit to the Daniel Avila's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

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