Repository navigation
fix(usage): count compressed Codex rollouts - #22590
Closed
Trench-Monster wants to merge 1 commit into
Closed
Trench-Monster wants to merge 1 commit into
Trench-Monster wants to merge 1 commit into
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex Usage skips compressed
.jsonl.zstrollouts because discovery accepts only.jsonland the parser expects decoded JSONL. Stream native zstd decompression into the existing parser, reuse unchanged-file caches, and reparse changed compressed snapshots from the beginning rather than applying decoded byte offsets to compressed input.This is a focused fix for the existing Usage capability under the small, obvious bug-fix exception in CONTRIBUTING.md. It changes no usage source identity, accounting contract, provider configuration, or UI. Archived-session discovery is already covered by #21664/#21666. Related #21795 fixes compressed session imports, which use a different reader.
Verification on macOS arm64, Node 24.21.0:
vp test run apps/server/src/usage/usageTranscriptReader.test.ts apps/server/src/usage/UsageService.test.ts apps/server/src/provider/Drivers/codexUsage.test.ts apps/server/src/usage/usageScanCache.test.ts.tsc-rs --noEmit -p apps/server/tsconfig.jsonand scoped lint/format passed.This uses Node's native zstd decoder. Its existing truncated-frame and concatenated-frame limitations are unchanged (nodejs/node#64592, nodejs/node#64741); verification covers ordinary single-frame snapshots. No desktop/mobile UI run is claimed for this current-main branch.
Written with GPT-6 in Codex.