Skip to content

fix(codex): guard truncated type fields from panicking the parser - #2034

Merged
ryoppippi merged 2 commits into
mainfrom
pullfrog/issue-2033-run-42285119528-attempt-1
Nov 7, 2026
Merged

ryoppippi merged 2 commits into
mainfrom
pullfrog/issue-2033-run-42285119528-attempt-1

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

References #2033: codex_line_type_flags in rust/adapters/codex/src/parser.rs advanced start to line.len() + 1 on truncated "type" fields (missing value or opening quote) and then sliced line[start..], panicking the whole report under the panic = "abort" release profile. Guarded the scan loop with start < line.len() so malformed lines fall through to the existing JSON skip path and valid surrounding usage is still counted.

Added skips_truncated_type_fields_without_losing_valid_usage regression test in rust/adapters/codex/src/loader.rs covering {"type" :, whitespace-only tails, empty values, and truncated nested payload.type fields around a valid token_count event.

Tests: new regression test panicked before the fix (range start index 11 out of range for slice of length 10 at parser.rs:739) and passes after; cargo test -p ccusage -p ccusage-adapter-codex --features ccusage/fetch-litellm-pricing --lib passes (162 passed); cargo fmt --all -- --check clean; cargo clippy -p ccusage -p ccusage-adapter-codex --all-targets --features ccusage/fetch-litellm-pricing -- -D warnings clean. Changes left uncommitted in the working tree.

Closes #2033


Summary by cubic

Fixes the Codex adapter parser panicking on truncated "type" fields in session lines. In release builds with panic = "abort", a malformed field (missing value or opening quote) advanced the scan index past the end of the line and sliced past the buffer, crashing the whole report. The scan loop is now guarded so malformed lines fall through to the existing JSON skip path while valid token_count usage on surrounding lines is still recorded.

Adds a regression test covering truncated "type" fields with missing values, whitespace-only tails, empty values, and truncated nested payload.type fields, verifying they are skipped without losing valid usage. Closes #2033.

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

View guided diff Turn on auto-fix

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f80e53c0-d781-4ea1-960d-557b813b1a04

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide ce7707f Commit Preview URL

Branch Preview URL
Nov 07 2026, 12:45 AM

@bvolpato bvolpato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed at 9a93a8a. No correctness findings. The bounds check covers both paths that advance the scanner past EOF, and the regression verifies that malformed records are skipped without losing valid surrounding usage.

I verified that this PR's entire source tree matches the patch I tested for #2033. The regression failed before the fix and passed afterward. Full Rust workspace tests, Node tests, Rust formatting, and Codex adapter Clippy passed. The patched release binary also completed the full offline report against the unchanged logs that reproduced the original crash.

Approving the code. Hosted CI and autofix.ci still show action_required with no jobs executed; those should run before merging. The Nix formatter and oxlint were unavailable locally, so their checks remain unverified.

@ryoppippi ryoppippi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@ryoppippi

Copy link
Copy Markdown
Member

/codesmith prove it

@blacksmith-sh

blacksmith-sh Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Your payment method failed for a Blacksmith invoice. [code]smith is paused until it is resolved. Update your payment method on the billing page.

Update payment method

@ryoppippi
ryoppippi merged commit 4fb1c0d into main Nov 7, 2026
23 checks passed
@ryoppippi
ryoppippi deleted the pullfrog/issue-2033-run-42285119528-attempt-1 branch November 7, 2026 00:46
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

ccusage performance comparison

PR SHA: 9a93a8a6bc5b
Base SHA: 53f316fcec90

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 364.6ms 2.76 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 347.0ms 2.90 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 152.7ms 6.59 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 128.8ms 7.81 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 39.5ms 14.8ms 2.66x 56.00 MiB 23.22 MiB 0.41x 0.04 MiB/s 0.10 MiB/s
claude session --offline --json 0.00 MiB 37.4ms 14.5ms 2.58x 56.00 MiB 23.22 MiB 0.41x 0.04 MiB/s 0.11 MiB/s
codex daily --offline --json 0.00 MiB 37.0ms 14.5ms 2.55x 55.50 MiB 27.21 MiB 0.49x 0.02 MiB/s 0.06 MiB/s
codex session --offline --json 0.00 MiB 38.6ms 14.8ms 2.62x 56.25 MiB 27.21 MiB 0.48x 0.02 MiB/s 0.06 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 369.1ms 351.1ms 1.05x 947.09 MiB 917.34 MiB 0.97x 2.73 GiB/s 2.87 GiB/s
codex --offline --json 1.01 GiB 146.9ms 119.3ms 1.23x 497.44 MiB 545.43 MiB 1.10x 6.85 GiB/s 8.44 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 27.64 KiB 27.64 KiB +0.00 KiB 1.00x
installed native package binary 4989.22 KiB 4989.16 KiB -0.06 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

ccusage performance comparison

PR SHA: 9a93a8a6bc5b
Base SHA: 53f316fcec90

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 391.7ms 2.57 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 359.6ms 2.80 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 149.4ms 6.74 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 124.6ms 8.08 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 37.2ms 36.6ms 1.02x 56.00 MiB 55.75 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 35.6ms 36.5ms 0.98x 55.75 MiB 56.25 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 36.7ms 36.6ms 1.00x 55.75 MiB 55.75 MiB 1.00x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 35.7ms 36.5ms 0.98x 55.50 MiB 55.75 MiB 1.00x 0.02 MiB/s 0.02 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 363.7ms 370.5ms 0.98x 939.34 MiB 909.08 MiB 0.97x 2.77 GiB/s 2.72 GiB/s
codex --offline --json 1.01 GiB 158.0ms 157.0ms 1.01x 509.44 MiB 545.43 MiB 1.07x 6.37 GiB/s 6.41 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 27.64 KiB 27.64 KiB +0.00 KiB 1.00x
installed native package binary 4989.22 KiB 4989.16 KiB -0.06 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

ccusage performance comparison

PR SHA: ce7707faaa40
Base SHA: f800ea63c88b

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 509.2ms 1.98 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 404.4ms 2.49 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 189.8ms 5.30 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 137.3ms 7.33 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 40.6ms 16.7ms 2.43x 55.75 MiB 23.22 MiB 0.42x 0.04 MiB/s 0.09 MiB/s
claude session --offline --json 0.00 MiB 36.6ms 16.4ms 2.23x 56.25 MiB 23.22 MiB 0.41x 0.04 MiB/s 0.09 MiB/s
codex daily --offline --json 0.00 MiB 36.6ms 15.8ms 2.32x 56.00 MiB 27.22 MiB 0.49x 0.02 MiB/s 0.05 MiB/s
codex session --offline --json 0.00 MiB 51.6ms 20.0ms 2.58x 56.00 MiB 27.21 MiB 0.49x 0.02 MiB/s 0.04 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 427.1ms 418.6ms 1.02x 909.34 MiB 913.34 MiB 1.00x 2.36 GiB/s 2.40 GiB/s
codex --offline --json 1.01 GiB 163.3ms 140.5ms 1.16x 501.43 MiB 487.43 MiB 0.97x 6.16 GiB/s 7.16 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 27.64 KiB 27.64 KiB +0.00 KiB 1.00x
installed native package binary 4989.22 KiB 4989.16 KiB -0.06 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

ccusage performance comparison

PR SHA: ce7707faaa40
Base SHA: f800ea63c88b

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 388.0ms 2.59 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 359.0ms 2.80 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 159.5ms 6.31 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 128.5ms 7.83 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 38.4ms 40.7ms 0.94x 55.75 MiB 55.50 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
claude session --offline --json 0.00 MiB 39.2ms 37.9ms 1.03x 55.75 MiB 56.00 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex daily --offline --json 0.00 MiB 38.1ms 38.8ms 0.98x 56.00 MiB 55.75 MiB 1.00x 0.02 MiB/s 0.02 MiB/s
codex session --offline --json 0.00 MiB 39.3ms 40.3ms 0.98x 55.75 MiB 56.00 MiB 1.00x 0.02 MiB/s 0.02 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 378.4ms 389.0ms 0.97x 911.34 MiB 915.09 MiB 1.00x 2.66 GiB/s 2.59 GiB/s
codex --offline --json 1.01 GiB 146.3ms 158.1ms 0.93x 513.43 MiB 531.44 MiB 1.04x 6.88 GiB/s 6.37 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 27.64 KiB 27.64 KiB +0.00 KiB 1.00x
installed native package binary 4989.22 KiB 4989.16 KiB -0.06 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

ryoppippi added a commit that referenced this pull request Nov 10, 2026
* docs(skills): credit issue reporters and reply after merging

Squash merges of #2050, #2051 and #2034 left out the reporters whose issues
drove the fixes, and #2004 and #1987 got no reply after the contributor pinged.
The create-pr skill now covers both steps at merge time, so they are no longer
left to memory.

* docs(skills): say how to add the reporter trailer and where to reply for a bare branch

* docs(skills): name the squash body flag, noreply lookup and pending release

* docs(skills): mention the next release only for shipped changes

* docs(skills): report the shipped release when it already exists
ryoppippi added a commit that referenced this pull request Nov 10, 2026
* docs(skills): credit issue reporters and reply after merging

Squash merges of #2050, #2051 and #2034 left out the reporters whose issues
drove the fixes, and #2004 and #1987 got no reply after the contributor pinged.
The create-pr skill now covers both steps at merge time, so they are no longer
left to memory.

* fix(claude): show model breakdowns for session --id

`ccusage claude session --id <ID>` ignored `--breakdown`, and its JSON
had no `modelBreakdowns`. The lookup path summed cost and tokens by
hand instead of building the `UsageSummary` that the session list
builds with `SessionAccumulator`, so it never had per-model data and
never reached the shared table renderer that draws breakdown rows.

Build the looked-up session through the same `SessionAccumulator` and
render the table with the shared `print_usage_table`, matching how
`codex session --id` reuses its session table. `--breakdown` now adds
per-model rows, and the JSON keeps its existing fields while adding
`modelsUsed` and `modelBreakdowns` (including `storedCost` and
`missingPricing` where they apply). The text summary with a separate
"Total Entries" line is replaced by the standard session table.

Codex already honors `--breakdown` for `--id` and the top-level
`ccusage session --id` routes to this Claude path, so no other agent
needed a change.

Co-authored-by: fdarian <[email protected]>

* docs(session): document model breakdowns for claude session --id

Describe the table and JSON shape of `ccusage claude session --id` now
that it shares the session table and emits `modelBreakdowns`, and note
that its breakdown entries mark unpriced models.

* Revert "docs(skills): credit issue reporters and reply after merging"

This reverts commit 3a33754.

---------

Co-authored-by: fdarian <[email protected]>
ryoppippi added a commit that referenced this pull request Nov 10, 2026
The squash merge of #2034 missed a Co-authored-by trailer for the reporter
whose issue (#2033) and reproduction drove the fix. This empty commit
records that credit.

Co-authored-by: Bruno Volpato <[email protected]>
Buster210 added a commit to Buster210/ccusage that referenced this pull request Nov 13, 2026
Upstream tip: 660e07c (2026-11-13,
chore(pricing): update models.dev snapshot)
Previous fork base: 30b653f (the upstream commit this fork was synced to)
Synced 100 upstream commits on top of 30b653f: 53 automated pricing
snapshot refreshes, 23 dependency bumps, 2 releases, and:
  3541115 feat(cline): add extension and CLI usage adapter (ccusage#1977)
  5e5c475 fix(antigravity): report real model names instead of placeholders (ccusage#2071)
  e39ed83 fix(claude): keep the cache TTL split when deduping equal copies (ccusage#2060)
  c17c591 feat(adapter): report 1h cache writes in JSON model breakdowns (ccusage#2059)
  a06f4bc perf(claude): halve `ccusage claude` report time (ccusage#2058)
  de43952 fix(claude): show model breakdowns for session --id (ccusage#2057)
  5f31039 fix(all): count only in-window Claude usage in unified session reports (ccusage#2052)
  e4f0ea9 fix(codex): count spawned subagent requests stamped at the fork instant (ccusage#2051)
  b85b28f fix(opencode): count usage from completed v2 compaction rows (ccusage#2050)
  00fead0 fix(antigravity): deduplicate unkeyed mirror usage (ccusage#2027)
  2248106 fix(opencode): exclude Claude Agent turns by default (ccusage#2022)
  4fb1c0d fix(codex): guard truncated type fields from panicking the parser (ccusage#2034)
  86707db build(perf): make the PR performance comparison catch real regressions (ccusage#2061)
  686a1a8 ci: support a merge queue on main (ccusage#2062)
Fork wins kept: the Codex optimized scanner with its fork-replay instant,
the Antigravity model resolver, the OpenCode retained-ledger cache with its
per-namespace rows, the SQLite on-disk cache, the table renderer, the fork
CI and tag-only release workflow, and the exact `=` dependency pins.
Hand-resolved conflicts:
  rust/adapters/claude/src/lib.rs: the fork's DedupedEntries copy pairs stay
    and take upstream's carries_more_usage_detail tiebreak (speed rank, then
    a cache TTL split); main_thread_session_days reads the recorded session
    of each copy.
  rust/adapters/opencode/{loader,parser}.rs: the fork's retain_via_ledger
    stays beside upstream's v2 compaction scan; SessionMessageKind and
    MessageRowColumns carry the row type through the five-value scan.
  rust/adapters/codex/{replay,parser}.rs: open_rollout_reader_with_capacity
    and CodexForkReplay both land in the shared parser state.
  rust/crates/ccusage-core/src/{cache,pricing}.rs: the opencode-db-compaction
    namespace joins the ledger namespaces; the fork's embedded pricing loader
    and OnceLock path stay.
  rust/crates/ccusage/src/cli/timezone.rs: Cline joins the shared-args arm,
    the ClearCache arm stays unreachable from the parser.
  rust/Cargo.toml: the fork's exact `=` pins stay; jiff 0.2.41,
    schemars 1.2.2, serde 1.0.229, smallvec 1.16.5, toml 1.2.1.
  .github/workflows/{ci,release}.yaml: the fork's design is kept, including
    its own release flow. Upstream's merge-queue, tagpr and pkg.pr.new jobs
    need scripts this fork deleted, so they are not taken; the two
    save-nix-cache inputs upstream passes to the native-package actions are
    dropped because the fork's composite actions declare no such input.
  packages/ccusage-*/package.json (6 files), the contribution-gate scripts,
    sponsors.md, blacksmith.png and rust/adapters/claude/src/daily.rs stay
    deleted; the two Blacksmith SVG logos upstream added are not taken.
Docs: the agent lists take upstream's Cline addition but keep this fork's
`pi` name, because the CLI subcommand is still `pi`; upstream renamed the
docs to `pi-agent` without renaming the command.
Snapshots regenerated for the fork table renderer: the Cline adapter, CLI
and unified reports, codex issue_2046, opencode compaction, claude session
--id and the config schema (new Cline section).
Validation: cargo test --workspace --offline 1297 passed, 0 failed; cargo
clippy --workspace --all-targets clean; rustfmt --check clean.
Version: take upstream's 20.0.50 in package.json, apps/ccusage/package.json
and docs/package.json; the Rust workspace keeps version 0.0.0.
DO NOT push a v20.0.50 tag from this fork: release.yaml would publish fork
bytes under upstream identity.
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.

Codex parser panics on truncated type fields

2 participants