fix(context): persist fallback compaction breaker

This commit is contained in:
kshitijk4poor 2026-07-14 01:50:20 +05:30 committed by kshitij
parent 5ce827cac9
commit af7dceaf77
10 changed files with 394 additions and 91 deletions

View file

@ -282,7 +282,14 @@ def _record_codex_app_server_compaction(
# 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"):
record_boundary = getattr(
type(compressor), "record_completed_compaction", None
)
if callable(record_boundary):
# Codex owns this summary. A prior Hermes deterministic-fallback
# flag must not leak into the native boundary's quality verdict.
record_boundary(compressor, used_fallback=False)
elif 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