feat(droid): add Factory Droid usage adapter#1028
Conversation
Read Droid settings files from local Factory session directories and expose focused daily, monthly, and session reports. This adds model and provider normalization, token aggregation including thinking tokens, LiteLLM-based cost estimation, CLI/config/schema wiring, snapshots, and documentation for the new data source.
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR adds Droid as a new supported coding agent in ccusage. The implementation spans configuration schema registration, CLI command parsing with droid-specific report kinds, a new adapter module for discovering and parsing Droid session settings files with cost calculation, framework wiring to integrate the adapter into the agent detection and output pipelines, and comprehensive documentation across guides, README, and navigation. ChangesDroid Agent Support
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | 667a2fd | Commit Preview URL Branch Preview URL |
May 19 2026, 06:43 PM |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/ccusage/scripts/generate-json-schema.ts (1)
245-245: ⚡ Quick winAdd a regression assertion for the new
droidschema namespace.Please add a
createConfigSchemaJsontest assertion likeexpect(properties).toHaveProperty('droid')so future changes can’t silently drop this namespace.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@apps/ccusage/scripts/generate-json-schema.ts` at line 245, Add a regression assertion to the createConfigSchemaJson test to ensure the 'droid' namespace isn't dropped: after the code that computes properties in the createConfigSchemaJson test, add an assertion like expect(properties).toHaveProperty('droid') so the generated schema includes the entry produced by createAgentJsonSchema('droid', agentCommandSchemas.droid); reference the properties variable, the 'droid' key, createAgentJsonSchema call, and the createConfigSchemaJson test body when adding the assertion.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/ccusage/src/adapter/droid/parser.ts`:
- Around line 94-118: The provider normalization in normalizeDroidProvider
trims, lowercases and replaces '-' with '_', so values like "x-ai" become "x_ai"
and currently miss the xAI branch; update normalizeDroidProvider to recognize
"x_ai" (in addition to "xai") in the xAI conditional (the normalized variable
within function normalizeDroidProvider) so it returns "xai" for both "x_ai" and
"xai".
In `@apps/ccusage/test/snapshots/cli-output/all-agent-daily-table.txt`:
- Around line 12-26: The table snapshot totals are inconsistent with the JSON
snapshots because the table renderer's aggregation is missing Droid's reasoning
tokens (and/or double-counting another agent); update the aggregation logic so
computeDailyTotals / aggregateAgentTotals / buildDailyAgentTable (or whatever
function builds the CLI rows) sums each agent's tokens as directTokens +
reasoningTokens (use the same token fields used by the JSON renderer, e.g.,
getAgentUsage/getDirectTokens/getReasoningTokens) and ensure renderAgentRow uses
that aggregated value so the All/Total rows match the all-agent-daily-json and
droid-direct-daily-json fixtures.
---
Nitpick comments:
In `@apps/ccusage/scripts/generate-json-schema.ts`:
- Line 245: Add a regression assertion to the createConfigSchemaJson test to
ensure the 'droid' namespace isn't dropped: after the code that computes
properties in the createConfigSchemaJson test, add an assertion like
expect(properties).toHaveProperty('droid') so the generated schema includes the
entry produced by createAgentJsonSchema('droid', agentCommandSchemas.droid);
reference the properties variable, the 'droid' key, createAgentJsonSchema call,
and the createConfigSchemaJson test body when adding the assertion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: daab5cc1-3e59-4303-b407-7a012a3cf716
📒 Files selected for processing (27)
apps/ccusage/README.mdapps/ccusage/config-schema.jsonapps/ccusage/scripts/generate-json-schema.tsapps/ccusage/src/adapter/droid/index.tsapps/ccusage/src/adapter/droid/parser.tsapps/ccusage/src/adapter/droid/paths.tsapps/ccusage/src/adapter/droid/pricing-macro.tsapps/ccusage/src/adapter/droid/pricing.tsapps/ccusage/src/adapter/index.tsapps/ccusage/src/adapter/types.tsapps/ccusage/src/commands/index.tsapps/ccusage/src/config-loader-tokens.tsapps/ccusage/test/cli-output.test.tsapps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txtapps/ccusage/test/snapshots/cli-output/all-agent-daily-table.txtapps/ccusage/test/snapshots/cli-output/droid-direct-daily-json.txtdocs/.vitepress/config.tsdocs/guide/all-reports.mddocs/guide/claude/index.mddocs/guide/codex/index.mddocs/guide/config-files.mddocs/guide/configuration.mddocs/guide/droid/index.mddocs/guide/environment-variables.mddocs/guide/getting-started.mddocs/guide/index.mddocs/index.md
Handle x-ai provider locks, assert the generated Droid config namespace, and render adapter-provided totalTokens in focused and all-agent tables so reasoning token totals stay consistent with JSON output.
|
@cubic-dev-ai review it |
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
|
@coderabbitai review it |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 12082 🏁 Script executed: Length of output: 9905 🏁 Script executed: Length of output: 119125
Review🐛 Bugs1.
// providerPrefixes('anthropic') → ['anthropic/']
// openrouter/anthropic/ is never tried
for (const candidate of createDroidModelCandidates(entry)) {
const result = await fetcher.calculateCostFromTokens(tokens, candidate);
...
}If LiteLLM's dataset stores a model exclusively under case 'anthropic':
return ['anthropic/', 'openrouter/anthropic/'];
case 'openai':
return ['openai/', 'openrouter/openai/'];
case 'google':
return ['google/', 'vertex_ai/', 'openrouter/google/'];
case 'xai':
return ['xai/', 'openrouter/x-ai/'];2. Eager module-level network request ( const PREFETCHED_DROID_PRICING = prefetchDroidPricing(); // fires on importThis fires unconditionally whenever the module is imported — even when the user runs
|
Replace the inline agent label conditional in the schema generator with a small exhaustive switch helper. This keeps future agent-specific labels out of nested ternaries and makes the config schema label rules easier to extend.
|
@coderabbitai review it |
|
@cubic-dev-ai review it |
@ryoppippi I have started the AI code review. It will take a few minutes to complete. |
|
✅ Actions performedReview triggered.
|
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: |
Remove the Droid-specific pricing macro so importing the adapter for schema generation or tests does not trigger a pricing dataset fetch. Offline Droid reports now follow the existing no-network behavior and return zero calculated cost unless pricing is supplied by the shared fetcher context.
|
@coderabbitai review it |
|
✅ Actions performedReview triggered.
|
ccusage performance comparisonThis compares the PR build against the base branch build on the same CI runner. 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
Package size
Lower medians and smaller packed package sizes are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@apps/ccusage/src/adapter/droid/pricing.ts`:
- Around line 22-45: providerPrefixes currently returns only native prefixes so
createDroidModelCandidates misses keys like openrouter/<provider>/...; update
providerPrefixes (used by createDroidModelCandidates and calculateDroidCost) to
include OpenRouter variants by returning both the native prefix and an
`openrouter/<nativePrefix>` variant for each provider (e.g., for 'google' return
['google/', 'vertex_ai/', 'openrouter/google/', 'openrouter/vertex_ai/'], for
generic providers include `openrouter/${provider}/` alongside `${provider}/`),
leaving 'unknown' as []. Ensure createDroidModelCandidates continues to map
those prefixes into candidate strings.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a8ddd7ea-8096-431c-83a4-813ced9ae051
📒 Files selected for processing (3)
apps/ccusage/src/adapter/droid/pricing.tsapps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txtapps/ccusage/test/snapshots/cli-output/droid-direct-daily-json.txt
✅ Files skipped from review due to trivial changes (2)
- apps/ccusage/test/snapshots/cli-output/droid-direct-daily-json.txt
- apps/ccusage/test/snapshots/cli-output/all-agent-daily-json.txt
Add OpenRouter-prefixed provider aliases when Droid usage records already identify the underlying provider. This lets the existing LiteLLM lookup path find prices published under OpenRouter without adding any separate pricing data fetch or macro layer. Cover the fallback with an in-source pricing test so the adapter keeps matching the shared pricing behavior.
|
@coderabbitai review it |
|
✅ Actions performedReview triggered.
|
Merge the current main Rust CLI migration into the Droid PR and replace the old TypeScript Droid adapter with a Rust implementation. The Rust adapter discovers *.settings.json files from DROID_SESSIONS_DIR or ~/.factory/sessions, normalizes Droid model/provider names, falls back to sidecar JSONL model hints, includes thinking tokens in total-token accounting, and prices thinking tokens as output-side usage. Also wires Droid into direct reports, all-agent reports, progress labels, config schema, CLI parsing, README, and docs.
|
@coderabbitai review Updated this PR to merge current main and port Droid support to the Rust CLI implementation. This now wires Droid into direct reports and all-agent reports, reads Droid *.settings.json files from DROID_SESSIONS_DIR/default ~/.factory/sessions, preserves thinking tokens in total-token accounting, and keeps Droid docs/config-schema integration. Local validation passed:
|
🧩 Analysis chain🏁 Script executed: Length of output: 338 🏁 Script executed: Length of output: 1569 🏁 Script executed: Length of output: 20783 🏁 Script executed: Length of output: 33127 🏁 Script executed: Length of output: 11461 🏁 Script executed: Length of output: 1821 🏁 Script executed: Length of output: 1512
Rust Port Review🐛 Bug
The fn agent_label(agent: &str) -> &str {
match agent {
"all" => "All",
"claude" => "Claude",
"codex" => "Codex",
"opencode" => "OpenCode",
"amp" => "Amp",
"pi" => "pi-agent",
_ => agent, // ← "droid" falls here
}
}Note that Fix: "amp" => "Amp",
+ "droid" => "Droid",
"pi" => "pi-agent",
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
rust/crates/ccusage/src/adapter/all.rs (1)
792-801:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd explicit display label for Droid in all-agent output.
Line 800 falls back to raw
"droid"becauseagent_labelis missing a"droid"arm, so output casing is inconsistent with other agents.💡 Suggested fix
fn agent_label(agent: &str) -> &str { match agent { "all" => "All", "claude" => "Claude", "codex" => "Codex", "opencode" => "OpenCode", "amp" => "Amp", + "droid" => "Droid", "pi" => "pi-agent", _ => agent, } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rust/crates/ccusage/src/adapter/all.rs` around lines 792 - 801, The agent_label function currently omits a case for "droid", causing raw "droid" to be used inconsistently; update the match in agent_label to include a "droid" arm that returns the desired display label "Droid" (i.e., add `"droid" => "Droid",`) alongside the existing arms so all-agent output uses a consistent cased label.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust/crates/ccusage/src/adapter/droid.rs`:
- Around line 133-141: The current loop (parsed.sort_by_key, seen_sessions
HashSet and for entry in parsed) keeps the oldest snapshot per session_id
because parsed is sorted ascending; change the dedup strategy to retain the
newest snapshot by sorting parsed in descending order by timestamp (so the
first-seen per session_id is the latest) or alternatively build a Map keyed by
session_id that replaces stored entries when a newer timestamp is found; then
push the retained newest entries through to_loaded_entry(entry, tz.as_ref(),
pricing) as before.
In `@rust/crates/ccusage/src/output.rs`:
- Around line 77-84: The non-compact table footer is still computing "Total
Tokens" without including extra_total_tokens, causing a mismatch with
totals_json; update the footer total calculation to add extra_total (the sum
computed as let extra_total = rows.iter().map(|row|
row.extra_total_tokens).sum::<u64>();) into the total shown in the footer (where
input + output + cache_create + cache_read is currently used), and ensure the
same inclusion is applied wherever the non-compact/footer total is computed so
it matches the totals_json/totalTokens value.
---
Outside diff comments:
In `@rust/crates/ccusage/src/adapter/all.rs`:
- Around line 792-801: The agent_label function currently omits a case for
"droid", causing raw "droid" to be used inconsistently; update the match in
agent_label to include a "droid" arm that returns the desired display label
"Droid" (i.e., add `"droid" => "Droid",`) alongside the existing arms so
all-agent output uses a consistent cased label.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 716b710f-def1-4123-be52-95f187c9a040
📒 Files selected for processing (22)
apps/ccusage/README.mdapps/ccusage/config-schema.jsondocs/.vitepress/config.tsdocs/guide/environment-variables.mddocs/guide/getting-started.mddocs/guide/index.mdrust/crates/ccusage/src/adapter/all.rsrust/crates/ccusage/src/adapter/amp.rsrust/crates/ccusage/src/adapter/droid.rsrust/crates/ccusage/src/adapter/mod.rsrust/crates/ccusage/src/adapter/opencode/mod.rsrust/crates/ccusage/src/adapter/opencode/parser.rsrust/crates/ccusage/src/adapter/pi.rsrust/crates/ccusage/src/claude_loader.rsrust/crates/ccusage/src/cli.rsrust/crates/ccusage/src/config.rsrust/crates/ccusage/src/config_schema.rsrust/crates/ccusage/src/main.rsrust/crates/ccusage/src/output.rsrust/crates/ccusage/src/progress.rsrust/crates/ccusage/src/summary.rsrust/crates/ccusage/src/types.rs
✅ Files skipped from review due to trivial changes (6)
- rust/crates/ccusage/src/adapter/opencode/parser.rs
- docs/.vitepress/config.ts
- docs/guide/index.md
- docs/guide/getting-started.md
- apps/ccusage/README.md
- rust/crates/ccusage/src/claude_loader.rs
🚧 Files skipped from review as they are similar to previous changes (2)
- apps/ccusage/config-schema.json
- docs/guide/environment-variables.md
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. |
…pter # Conflicts: # apps/ccusage/README.md # apps/ccusage/config-schema.json # docs/.vitepress/config.ts # docs/guide/all-reports.md # docs/guide/claude/index.md # docs/guide/codex/index.md # docs/guide/config-files.md # docs/guide/configuration.md # docs/guide/environment-variables.md # docs/guide/getting-started.md # docs/guide/index.md # docs/index.md # rust/crates/ccusage/src/adapter/all.rs # rust/crates/ccusage/src/adapter/mod.rs # rust/crates/ccusage/src/cli.rs # rust/crates/ccusage/src/config.rs # rust/crates/ccusage/src/config_schema.rs # rust/crates/ccusage/src/output.rs # rust/crates/ccusage/src/types.rs
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 3165
The deduplication now iterates with All previously flagged issues are now resolved:
🐰 ✨ |
…pter # Conflicts: # rust/crates/ccusage/src/cli.rs
|
@coderabbitai review Merged latest main into the Droid PR and resolved the current CLI help conflict using the namespace-only root help from main plus Droid. Local checks passed:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 7535
✅ Merge Integration — All Good
|
|
@coderabbitai review Addressed the remaining Droid table-total review by making the non-compact footer use totals_json.totalTokens, so extra_total_tokens are included consistently with JSON and row totals. Local checks passed:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 5307 🏁 Script executed: Length of output: 8021
The root cause was exactly right:
|
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 size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
…pter # Conflicts: # apps/ccusage/README.md # docs/guide/all-reports.md # docs/guide/claude/index.md # docs/guide/codex/index.md # docs/guide/config-files.md # docs/guide/configuration.md # docs/guide/index.md # docs/index.md # rust/crates/ccusage/src/adapter/all.rs # rust/crates/ccusage/src/cli.rs # rust/crates/ccusage/src/config_schema.rs
Regenerate and format the config schema after syncing the branch with the latest main changes. The pre-commit schema hook rewrites enum arrays using the current oxfmt output, so this keeps the checked-in schema aligned with the generated artifact.
|
@coderabbitai review Synced this PR with latest main after #1031 was merged, resolved the Kimi/Droid conflicts, regenerated/formatted config schema, and pushed follow-up commits. Local checks:
|
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: Length of output: 4142 🏁 Script executed: Length of output: 27 🏁 Script executed: Length of output: 79 🏁 Script executed: Length of output: 264 🏁 Script executed: Length of output: 914 🏁 Script executed: Length of output: 920
✅ All Previously Flagged Issues Resolved
✅ Kimi Integration Looks Clean
The PR looks good to go! 🐰 🎉 [approve] |
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. |
…pter # Conflicts: # apps/ccusage/README.md # docs/guide/all-reports.md # docs/guide/config-files.md # docs/guide/configuration.md # docs/guide/index.md # docs/index.md # rust/crates/ccusage/src/adapter/all.rs # rust/crates/ccusage/src/cli.rs # rust/crates/ccusage/src/config_schema.rs
|
@coderabbitai review Synced this Droid PR with the latest main after #1019 landed, resolved the OpenClaw/Kimi integration conflicts, regenerated/formatted the config schema, and pushed the updates. Local checks run:
|
🧩 Analysis chain🏁 Script executed: Unrecoverable error: Failed to clone repository
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/guide/environment-variables.md (1)
15-31:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate the debug grep pattern to include
DROID.This page now documents
DROID_SESSIONS_DIR, but the debugging snippet later still won’t surface it. AddDROIDto that regex so troubleshooting examples stay aligned with the documented variables.Suggested doc fix
-env | grep -E "CLAUDE|CODEX|OPENCODE|AMP|HERMES|PI_AGENT|GOOSE|KILO|COPILOT|GEMINI|CCUSAGE|LOG_LEVEL" +env | grep -E "CLAUDE|CODEX|OPENCODE|AMP|DROID|HERMES|PI_AGENT|GOOSE|KILO|COPILOT|GEMINI|CCUSAGE|LOG_LEVEL"🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/guide/environment-variables.md` around lines 15 - 31, The debug grep pattern used later in the document doesn't include DROID, so DROID_SESSIONS_DIR won't be matched; update the troubleshooting/debugging regex to include "DROID" (alongside existing tokens) so examples will surface DROID_SESSIONS_DIR, and verify the pattern references DROID_SESSIONS_DIR by name in the example usage (e.g., the export/grep demonstration) to keep docs and debug snippet aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/guide/environment-variables.md`:
- Around line 15-31: The debug grep pattern used later in the document doesn't
include DROID, so DROID_SESSIONS_DIR won't be matched; update the
troubleshooting/debugging regex to include "DROID" (alongside existing tokens)
so examples will surface DROID_SESSIONS_DIR, and verify the pattern references
DROID_SESSIONS_DIR by name in the example usage (e.g., the export/grep
demonstration) to keep docs and debug snippet aligned.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: dcd76bd2-2e6c-4131-abc5-a98e19d77e9e
📒 Files selected for processing (22)
apps/ccusage/README.mdapps/ccusage/config-schema.jsondocs/.vitepress/config.tsdocs/guide/all-reports.mddocs/guide/claude/index.mddocs/guide/codex/index.mddocs/guide/config-files.mddocs/guide/configuration.mddocs/guide/droid/index.mddocs/guide/environment-variables.mddocs/guide/getting-started.mddocs/guide/index.mddocs/index.mdrust/crates/ccusage/src/adapter/all.rsrust/crates/ccusage/src/adapter/droid.rsrust/crates/ccusage/src/adapter/mod.rsrust/crates/ccusage/src/cli.rsrust/crates/ccusage/src/config.rsrust/crates/ccusage/src/config_schema.rsrust/crates/ccusage/src/main.rsrust/crates/ccusage/src/output.rsrust/crates/ccusage/src/progress.rs
✅ Files skipped from review due to trivial changes (9)
- docs/guide/droid/index.md
- docs/guide/config-files.md
- docs/guide/all-reports.md
- docs/index.md
- docs/guide/index.md
- apps/ccusage/README.md
- docs/guide/codex/index.md
- docs/guide/configuration.md
- docs/guide/getting-started.md
🚧 Files skipped from review as they are similar to previous changes (10)
- rust/crates/ccusage/src/adapter/mod.rs
- rust/crates/ccusage/src/progress.rs
- rust/crates/ccusage/src/config.rs
- rust/crates/ccusage/src/main.rs
- docs/.vitepress/config.ts
- apps/ccusage/config-schema.json
- rust/crates/ccusage/src/adapter/all.rs
- rust/crates/ccusage/src/config_schema.rs
- rust/crates/ccusage/src/cli.rs
- rust/crates/ccusage/src/adapter/droid.rs
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. |
Try This PR
Summary
Validation
Summary by CodeRabbit
Release Notes
New Features
DROID_SESSIONS_DIRenvironment variableDocumentation