codeburn icon indicating copy to clipboard operation
codeburn copied to clipboard

Feature Request: ChatGPT desktop app provider support

Open nkmd108 opened this issue 6 months ago • 4 comments

Feature Request: ChatGPT Desktop App Provider

Summary

Codeburn currently has a --provider chatgpt flag but it returns zero data. The ChatGPT desktop app (macOS) stores local data at:

  • ~/Library/Application Support/com.openai.chat/
    • ~/Library/Application Support/com.openai.atlas/ Both directories contain SQLite databases (logs_2.sqlite, state_5.sqlite) but they do not appear to contain token-level usage data in a format codeburn can parse.

Expected Behavior

Running codeburn report --provider chatgpt should surface token usage and cost data from ChatGPT desktop app sessions, similar to how Claude Code sessions are read from ~/.claude/.

Current Behavior

--provider chatgpt returns 0 calls, 0 tokens, $0.00 cost despite active ChatGPT desktop app usage.

Environment

  • macOS (Apple Silicon)
    • Codeburn v0.9.6
      • ChatGPT desktop app installed (com.openai.chat + com.openai.atlas)

Notes

If the ChatGPT desktop app does not expose per-session token data locally, an alternative approach could be reading from the OpenAI API usage endpoint (requires an API key) or supporting the OpenAI Codex CLI session format as a proxy for GPT model usage.

Would be happy to share more details about the local file structure if helpful.

nkmd108 avatar May 05 '26 20:05 nkmd108

Implemented this as a diagnostic spike in PR #314: https://github.com/getagentseal/codeburn/pull/314

The PR intentionally does not add a real chatgpt usage provider yet. It adds codeburn doctor chatgpt-desktop, which:

  • checks the reported macOS storage roots: ~/Library/Application Support/com.openai.chat and ~/Library/Application Support/com.openai.atlas
  • recursively finds local SQLite databases such as logs_2.sqlite / state_5.sqlite
  • opens them through CodeBurn's read-only SQLite wrapper
  • reports schema metadata only: database filenames, table/view counts, and usage-like column names
  • redacts the home directory to ~ in text and JSON output
  • does not read conversation rows, message text, or column values

The goal is to confirm whether ChatGPT Desktop exposes defensible local token/cost fields before shipping a provider. If the diagnostic shows stable columns like prompt_tokens, completion_tokens, model, or cost_usd, the next PR can add the real provider with fixtures. If it only shows state/log tables, this should stay blocked on upstream local storage/API data rather than estimating costs from message text.

Once the PR branch is available locally, the useful command for affected machines is:

codeburn doctor chatgpt-desktop --format json

If the app data is in a custom location:

CODEBURN_CHATGPT_DESKTOP_DIRS="/path/to/com.openai.chat:/path/to/com.openai.atlas" \
  codeburn doctor chatgpt-desktop --format json

On my machine those ChatGPT Desktop roots are not present, so the local result is storage-not-found; this needs output from a machine that has the desktop app data.

ozymandiashh avatar May 11 '26 22:05 ozymandiashh

the part that breaks parsing chatgpt desktop's sqlite isn't reading the files, it's that those databases are private state openai changes between minor app versions. logs_2.sqlite and state_5.sqlite have no documented schema and no commitment to backward compatibility, so the next desktop update can rename columns or restructure tables without notice. you'd be building on an interface that's free to break weekly. the usage API has a stable contract but loses per-session granularity, which is what codeburn actually needs. no clean middle path unless openai ships a local usage export.

m13v avatar May 24 '26 01:05 m13v

Closing as not planned for now, blocked upstream: the diagnostic spike (#314, codeburn doctor chatgpt) and the analysis in this thread stand. The ChatGPT desktop databases are private state whose schema OpenAI reshuffles between minor versions, and they do not expose stable per-message token usage, so a provider built on them would silently break and misprice. The --provider chatgpt flag remains reserved. Happy to reopen the moment OpenAI ships stable local usage data (or an export/API worth polling); subscribe here if you spot that happening.

ozymandiashh avatar Aug 03 '26 23:08 ozymandiashh

Reporting back with the output you asked for, from a machine that has the ChatGPT Desktop data. Agreeing with the close, and adding a data point that strengthens it.

I ran the #314 spike branch (spike/chatgpt-desktop-provider, b0c9571) against my install.

Versions: ChatGPT Desktop 26.901.51231, ChatGPT Atlas 1.2026.189.1, macOS 26.6.2.

ChatGPT Desktop diagnostics

Storage roots:
  found  ~/Library/Application Support/com.openai.chat
  found  ~/Library/Application Support/com.openai.atlas

SQLite databases: 6
  browser-data/host/heavy_ad_intervention_opt_out.db (x5 profiles)
    tables/views: 2
    usage-like columns: none
  browser-data/host/first_party_sets.db
    tables/views: 7
    usage-like columns: none

Conclusion: no-usage-candidates

The part worth noting: com.openai.chat no longer contains any SQLite databases at all. The whole directory is 108 KB and holds only app_pairing_extensions/ stubs. The logs_2.sqlite and state_5.sqlite files I described when I opened this issue in May are gone as of the build above. Every database the diagnostic found is under com.openai.atlas, and all of it is ordinary Chromium plumbing.

So the concern in this thread was not just that the schema is undocumented. Between May and September the files themselves disappeared. Anything built on them would have shipped and then broken within one release cycle.

One small note on the spike itself: findSqliteFiles uses maxDepth: 4, which misses browser-data/host/GPUPersistentCache/GPUCache/<hash>/cache.db at depth 5. I confirmed by hand that it is a GPU cache with no usage columns, so it does not change the conclusion, but the default depth is slightly too shallow for the Atlas tree if this is ever revived.

Happy to re-run this if OpenAI ships a local usage export and you want fresh schema output.

nkmd108 avatar Sep 08 '26 03:09 nkmd108