refactor(adapter): move Codex loader under adapters#1131
Conversation
Move the Codex loader from the crate root into the Codex adapter module so the runtime source-specific logic lives under src/adapter/codex. This mirrors the Claude adapter layout, removes the root-level codex_loader module, and updates all internal callers to use the Codex adapter surface. The snapshot file moves with the adapter module so insta keeps the same expected output under the new source path.
|
@coderabbitai review Pushed commit `65fc9e9` for the Codex adapter layout move. Please review this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | a93310d | Commit Preview URL Branch Preview URL |
May 23 2026, 02:53 PM |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 8198 🏁 Script executed: Length of output: 1526
Review Summary ✅No functional changes — pure module reorganization. What was verified
Minor observation (non-blocking)The relocated snapshot file has a stale It should now reflect The PR achieves its goal perfectly. No issues. [approve] |
Update the insta snapshot metadata to point at adapter/codex/mod.rs after moving the Codex adapter module. This addresses the non-blocking CodeRabbit observation and keeps the stored snapshot aligned with the new module path.
|
@coderabbitai review Pushed commit `a93310d` to update the moved Codex snapshot metadata after your non-blocking observation. Please review the latest change. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 864
(ノ◕ヮ◕)ノ*:・゚✧ [approve] |
ccusage
@ccusage/ccusage-darwin-arm64
@ccusage/ccusage-darwin-x64
@ccusage/ccusage-linux-arm64
@ccusage/ccusage-linux-x64
@ccusage/ccusage-win32-arm64
@ccusage/ccusage-win32-x64
commit: |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares 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
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated 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
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares 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
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated 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
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares 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
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated 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
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runner startupExecution setup measures any pre-benchmark package materialization used by the execution benchmark. Bunx temp cache measures one
Cached bunx execution performanceRuns the same large fixture through Fixtures: Claude
Package runtime diagnosticsCompares 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
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated 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
Artifact sizeLower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |

Move the Codex loader into the Codex adapter subtree so source-specific runtime logic lives under src/adapter/codex alongside command/report wiring.
This mirrors the Claude adapter layout by converting adapter/codex.rs to adapter/codex/mod.rs, moving codex_loader.rs to adapter/codex/loader.rs, and updating internal call sites to use the adapter surface.
Testing:
@coderabbitai review
Summary by cubic
Moved the Codex loader under
src/adapter/codexto keep runtime logic with the adapter and mirror the Claude adapter layout. No behavior changes; imports, tests, and the insta snapshot path were updated.codex_loadertoadapter/codex/loader.rsand splitadapter/codex.rsintoadapter/codex/mod.rs.adapter::codex::load_codex_events; internal callers useloader::*.codex_loaderexports and module; tests calladapter::codex::load_codex_events_from_directory.adapter/codex/snapshotsand updated itssourcetoadapter/codex/mod.rs.Written for commit a93310d. Summary will update on new commits. Review in cubic
Summary by CodeRabbit