Skip to content

Stabilize cross-file usage accounting and verification#1

Merged
majiayu000 merged 2 commits intomainfrom
codex/stabilize-usage-accounting
Apr 27, 2026
Merged

Stabilize cross-file usage accounting and verification#1
majiayu000 merged 2 commits intomainfrom
codex/stabilize-usage-accounting

Conversation

@majiayu000
Copy link
Copy Markdown
Owner

Summary

  • scope session identity and Claude deduplication per source log file to prevent cross-file collisions
  • correct offline fallback pricing for GPT-5.4 model variants and make invalid currency conversion fall back to USD
  • align CLI/package/docs copy with the current Claude + Codex surface and clear remaining clippy findings

Testing

  • cargo fmt -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6169e3a65

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 213 to 214
let ts = entry.timestamp?;
let msg = entry.message?;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve project attribution when including sidechain entries

This change makes parse_entry_with_debug accept every sidechain record, but parse_claude_file_with_debug still derives project_path from the immediate parent directory, so records from ~/.claude/projects/<project>/subagents/*.jsonl are now attributed to a synthetic subagents project instead of <project>. In environments that have subagent logs, project/session outputs will split totals incorrectly and undercount the real project after this commit.

Useful? React with 👍 / 👎.

@majiayu000
Copy link
Copy Markdown
Owner Author

/gemini review

Scope session identity and Claude deduplication to the source log file so
unrelated files no longer collapse into the same session or message bucket.

Also correct offline GPT-5.4 fallback pricing, downgrade currency lookup
failures to a USD fallback, and bring CLI/package/docs copy in line with the
current Claude + Codex surface while cleaning pedantic clippy issues.

Constraint: Existing workspace already contained local parser and integration-test edits; preserve them while landing the accounting fixes
Constraint: Keep user-facing session_id output stable while fixing internal session identity
Rejected: Replace session_id with full file paths in output | would fix collisions but degrade CLI readability and downstream JSON/CSV expectations
Rejected: Keep currency conversion failure as a fatal error | makes offline and first-run usage unnecessarily brittle
Confidence: high
Scope-risk: moderate
Directive: session_key is an internal scoping field only; do not expose it in user-facing output without an explicit migration plan
Tested: cargo fmt -- --check; cargo clippy --all-targets --all-features -- -D warnings; cargo test
Not-tested: Live LiteLLM schema drift and live exchange-rate fetch behavior
@majiayu000 majiayu000 force-pushed the codex/stabilize-usage-accounting branch from ff2a66f to 118ac4d Compare April 27, 2026 09:32
@majiayu000 majiayu000 merged commit 04f19ee into main Apr 27, 2026
2 checks passed
@majiayu000 majiayu000 deleted the codex/stabilize-usage-accounting branch April 27, 2026 09:33
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.

1 participant