fix(codex): evaluate native compaction usage

This commit is contained in:
kshitijk4poor 2026-07-11 12:29:06 +05:30 committed by kshitij
parent b8d467bad9
commit ec6982fbcf
2 changed files with 16 additions and 3 deletions

View file

@ -279,6 +279,11 @@ def _record_codex_app_server_compaction(
compressor, "compression_count", 0
) + 1
compressor.last_compression_rough_tokens = approx_tokens or 0
# The app server has already completed a real compaction boundary. Its
# usage update (when supplied) is therefore the same real-vs-real
# effectiveness verdict used by the normal compression path.
if hasattr(compressor, "_verify_compaction_cleared_threshold"):
compressor._verify_compaction_cleared_threshold = True
if not getattr(turn, "token_usage_last", None):
compressor.last_prompt_tokens = -1
compressor.last_completion_tokens = 0