[codex-analytics] split compaction v2 analytics implementation (#24146)

## What changed

- Add a distinct `responses_compaction_v2` value for
`CodexCompactionEvent.implementation`.
- Emit that value from the remote compaction v2 path.
- Keep local compaction as `responses` and legacy `/responses/compact`
as `responses_compact`.

## Why

Remote compaction v2 and local prompt-based compaction were both
reported as `responses`, which made the analytics table collapse two
different compaction mechanisms into one implementation bucket.

## Validation

- `just fmt`
- `just test -p codex-analytics`

`just test -p codex-core` was started locally, but this PR is
intentionally being pushed for CI to finish the remaining validation.
This commit is contained in:
rhan-oai authored and GitHub committed 2026-05-22 21:34:22 +00:00
1 parent 423488480f
commit 6419402a7c
3 files changed
+10 -1

No files matched your search

@@ -1262,6 +1262,14 @@ fn compaction_event_serializes_expected_shape() {
); );
} }
#[test]
fn compaction_implementation_serializes_remote_v2() {
let payload = serde_json::to_value(CompactionImplementation::ResponsesCompactionV2)
.expect("serialize compaction implementation");
assert_eq!(payload, json!("responses_compaction_v2"));
}
#[test] #[test]
fn app_used_dedupe_is_keyed_by_turn_and_connector() { fn app_used_dedupe_is_keyed_by_turn_and_connector() {
let (sender, _receiver) = mpsc::channel(1); let (sender, _receiver) = mpsc::channel(1);
+1
View File
@@ -229,6 +229,7 @@ pub enum CompactionReason {
#[serde(rename_all = "snake_case")] #[serde(rename_all = "snake_case")]
pub enum CompactionImplementation { pub enum CompactionImplementation {
Responses, Responses,
ResponsesCompactionV2,
ResponsesCompact, ResponsesCompact,
} }
+1 -1
View File
@@ -111,7 +111,7 @@ async fn run_remote_compact_task_inner(
turn_context.as_ref(), turn_context.as_ref(),
trigger, trigger,
reason, reason,
CompactionImplementation::Responses, CompactionImplementation::ResponsesCompactionV2,
phase, phase,
) )
.await; .await;