mirror of
https://github.com/openai/codex.git
synced 2026-11-13 22:47:20 +00:00
Track compaction time in turn profiles (#34835)
## What changed - Add `compaction_ms` to turn profile facts and turn analytics events. - Measure manual and automatic compaction as an exclusive profile phase instead of including it in surrounding idle time. - Complete the profile and total turn duration from the same instant so their elapsed times remain consistent. ## Testing - Cover compaction phase accounting and profile-duration consistency. - Update turn event serialization coverage for `compaction_ms`. GitOrigin-RevId: 50f0e1cf19789a807f9f56c2ef763c620a5d641c
This commit is contained in:
1 parent
88f1cd9664
commit
bd5b55e403
9 files changed
+114
-18
No files matched your search
@@ -32,6 +32,7 @@ impl SessionTask for CompactTask {
|
||||
_cancellation_token: CancellationToken,
|
||||
) -> SessionTaskResult {
|
||||
let session = session.clone_session();
|
||||
let _profile_guard = ctx.turn_timing_state.begin_compaction();
|
||||
if ctx.config.features.enabled(Feature::TokenBudget) {
|
||||
crate::compact_token_budget::run_manual_compact_task(session, ctx).await?;
|
||||
return Ok(None);
|
||||
|
||||
Reference in new issue
Block a user