Add active context token counts to compaction analytics

This commit is contained in:
Roy Han
2026-04-08 17:01:03 -07:00
parent fab253fdab
commit 76a44909f7
4 changed files with 24 additions and 1 deletions

View File

@@ -270,6 +270,8 @@ fn compaction_event_serializes_expected_shape() {
mode: CompactionMode::Remote,
status: CompactionStatus::Completed,
error: None,
active_context_tokens_before: 120_000,
active_context_tokens_after: 18_000,
started_at: 100,
completed_at: 106,
duration_ms: Some(6543),
@@ -289,6 +291,8 @@ fn compaction_event_serializes_expected_shape() {
"mode": "remote",
"status": "completed",
"error": null,
"active_context_tokens_before": 120000,
"active_context_tokens_after": 18000,
"started_at": 100,
"completed_at": 106,
"duration_ms": 6543
@@ -507,6 +511,8 @@ async fn compaction_event_ingests_custom_fact() {
mode: CompactionMode::Local,
status: CompactionStatus::Failed,
error: Some("context limit exceeded".to_string()),
active_context_tokens_before: 131_000,
active_context_tokens_after: 131_000,
started_at: 100,
completed_at: 101,
duration_ms: Some(1200),