Skip to content

No usage stats for OpenCode on windows #359

Closed

Description

@KanAtGodo

I have installed codeburn version 0.9.9 on Windows 10 but it would not show me any usage data for my OpenCode sessions. There was no error, just the message that there is no data found.

I used OpenCode then to investigate and it has found the issue and fixed it locally for me.
This is the summary of the issue and the resolution:

Codeburn 0.9.9 - OpenCode Provider Fix

Problem

Codeburn reports "No usage data found" despite OpenCode sessions existing in ~/.local/share/opencode/opencode.db.

Root Cause

In parseProviderSources (main.js:8396), codeburn calls fingerprintFile2(source.path) where source.path for sqlite-based providers (OpenCode, Goose, Cursor) is encoded as:

C:\Users\{username}\.local\share\opencode\opencode.db:ses_1bfc913a9ffeSBZlb0fto2jHK0

The :sessionId suffix makes stat() fail:

  • Windows: Interpreted as an NTFS Alternate Data Stream (ADS) — the stream doesn't exist.
  • Linux/macOS: No file exists with a literal : in the name at that path.

Since fingerprintFile2 returns null on failure, all sessions are silently skipped.

Fix Applied

File: C:\Program Files\nodejs\node_modules\codeburn\dist\main.js
Line: 8396

Before

const fp = await fingerprintFile2(source.path);

After

const fpPath = source.path.replace(/\.db:.+$/, '.db');
const fp = await fingerprintFile2(fpPath);

This strips the :sessionId suffix before calling stat(), allowing the fingerprint to resolve against the actual .db file.

Notes

  • This is a local patch that will be overwritten on npm update.
  • This likely affects all sqlite-based providers (OpenCode, Goose, Cursor) on all platforms.
  • Consider reporting upstream at the codeburn repository.

Activity

  1. ozymandiashh commented on May 19, 2026

    @ozymandiashh
    Collaborator

    Thanks for the detailed report. This matches the compound SQLite source-path bug that was present in [email protected]: OpenCode discovery emitted paths like <opencode.db>:<sessionId>, and the cache fingerprinting tried to stat() that virtual path.

    This is fixed on main by #347, with the compound-path handling further covered in #358. I also verified the behavior against a Windows-shaped OpenCode path:

    • v0.9.9: <db>:<session> fingerprint resolves null
    • origin/main: <db>:<session> fingerprint resolves the underlying .db
    • npx vitest run tests/session-cache.test.ts: 50/50 passed

    The remaining blocker is release availability: npm currently still publishes 0.9.9, while main is already bumped to 0.9.10. I’d keep this open until 0.9.10 is published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions