Skip to content

feat(usage): add local usage storage [1 of 4]#24121

Open
fcoury-oai wants to merge 2 commits into
mainfrom
fcoury/usage-storage
Open

feat(usage): add local usage storage [1 of 4]#24121
fcoury-oai wants to merge 2 commits into
mainfrom
fcoury/usage-storage

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented May 22, 2026

Why

This starts the local foundation for a token-share usage report without adding UI or app-server API surface yet. The data is intentionally local and forward-only.

What Changed

  • Adds protocol types for usage attribution contributors and samples.
  • Adds SQLite storage, retention, and daily/weekly usage aggregation.
  • Adds rollout compatibility coverage for legacy usage attribution lines so usage stays SQLite-only.

How to Test

Targeted tests:

  • cargo test -p codex-state usage
  • cargo test -p codex-rollout load_rollout_items_skips_legacy_usage_attribution_lines

Stack

  1. #24121 - Usage storage (this PR)
  2. #24122 - Usage attribution
  3. #24123 - App-server usage API
  4. #24124 - TUI /usage command

Copy link
Copy Markdown
Contributor

@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: c3ef23347f

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/state/src/runtime/usage.rs Outdated
Comment thread codex-rs/state/src/runtime/usage.rs
Comment thread codex-rs/state/src/runtime/usage.rs
Comment thread codex-rs/state/src/runtime/usage.rs Outdated
@fcoury-oai fcoury-oai changed the title feat(usage): add local usage storage feat(usage): add local usage storage [1 of 4] May 22, 2026
@fcoury-oai fcoury-oai force-pushed the fcoury/usage-storage branch from c3ef233 to f5afec4 Compare May 22, 2026 19:19
@fcoury-oai fcoury-oai force-pushed the fcoury/usage-storage branch from f5afec4 to 357d711 Compare May 22, 2026 19:29
@fcoury-oai
Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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