Skip to content

feat: add manual and remote_v2 tags to compaction metric#24608

Merged
jif-oai merged 1 commit into
mainfrom
jif/better-compaction-metrics
May 26, 2026
Merged

feat: add manual and remote_v2 tags to compaction metric#24608
jif-oai merged 1 commit into
mainfrom
jif/better-compaction-metrics

Conversation

@jif-oai

@jif-oai jif-oai commented May 26, 2026

Copy link
Copy Markdown
Collaborator

Why

codex.task.compact only distinguished local vs remote, which made it hard to answer simple counter questions in Statsig. Manual /compact and automatic compaction were collapsed together, and the legacy remote path was also collapsed with remote_compaction_v2.

What Changed

  • route codex.task.compact through a shared helper in core/src/tasks/mod.rs
  • add a manual=true|false tag so manual and automatic compaction can be counted separately
  • split the remote tag into remote and remote_v2
  • emit the metric from the inline auto-compaction path in core/src/session/turn.rs as well as the manual CompactTask path in core/src/tasks/compact.rs
  • add focused unit coverage for the new tag shapes in core/src/tasks/mod_tests.rs

Verification

  • added unit coverage in core/src/tasks/mod_tests.rs covering manual remote_v2 tags and automatic local tags

@jif-oai jif-oai requested a review from a team as a code owner May 26, 2026 16:26
@jif-oai

jif-oai commented May 26, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@jif-oai jif-oai changed the title feat: better compaction metric feat: add manual and remote_v2 tags to compaction metric May 26, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ 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".

@jif-oai jif-oai merged commit 9271e84 into main May 26, 2026
30 checks passed
@jif-oai jif-oai deleted the jif/better-compaction-metrics branch May 26, 2026 16:47
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant