mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-07-22 23:44:25 +00:00
VS Code GitHub Copilot Chat users with no OTel agent-traces.db and no ~/.copilot/session-state/ saw $0.00 cost: codeburn never read VS Code's core chat persistence, the only on-disk source carrying their token counts. Add a fourth Copilot source that reads the VS Code chat delta-journals at workspaceStorage/<hash>/chatSessions/*.jsonl and globalStorage/emptyWindowChatSessions/*.jsonl. The files are a kind:0 snapshot / kind:1 path-set / kind:2 array-append journal; we replay it (prototype-pollution-safe: __proto__/prototype/constructor segments are rejected and containers use Object.create(null)) and read each request's result.metadata.promptTokens / outputTokens (falling back to completionTokens) and resolvedModel for pricing. Dedup so users with multiple sources are not double-counted: prefer OTel (skip chatSessions discovery when an OTel source is present), and skip a workspace's legacy GitHub.copilot-chat/transcripts when that workspace has chatSessions. New env overrides CODEBURN_COPILOT_GLOBAL_STORAGE_DIR and the existing CODEBURN_COPILOT_WS_STORAGE_DIR keep discovery testable. Tests cover the reporter's real request shape (promptTokens 32543 / outputTokens 60 -> non-zero cost), empty sessions, emptyWindow discovery, append-then-edit replay, requestId dedup, prototype-pollution paths, the transcript skip, and the OTel-prefer skip. |
||
|---|---|---|
| .. | ||
| antigravity.test.ts | ||
| claude-config-dirs.test.ts | ||
| cline.test.ts | ||
| codebuff.test.ts | ||
| codex.test.ts | ||
| copilot.test.ts | ||
| crush.test.ts | ||
| cursor-agent.test.ts | ||
| cursor-bubble-dedup.test.ts | ||
| cursor-large-db-cap.test.ts | ||
| cursor-workspace-breakdown.test.ts | ||
| cursor.test.ts | ||
| devin.test.ts | ||
| droid.test.ts | ||
| forge.test.ts | ||
| gemini.test.ts | ||
| grok.test.ts | ||
| hermes.test.ts | ||
| ibm-bob.test.ts | ||
| kilo-code.test.ts | ||
| kimi.test.ts | ||
| kiro.test.ts | ||
| mistral-vibe.test.ts | ||
| mux.test.ts | ||
| omp.test.ts | ||
| open-design.test.ts | ||
| openclaw.test.ts | ||
| opencode-file.test.ts | ||
| opencode.test.ts | ||
| pi.test.ts | ||
| roo-code.test.ts | ||
| vercel-gateway.test.ts | ||
| vscode-cline-parser.test.ts | ||
| warp.test.ts | ||
| zcode.test.ts | ||
| zerostack.test.ts | ||