Skip to content

The agent that grows with you

fix(agent): drop the micro-compaction cursor snapshot/restore

kshitijk4poor58378c25c477
diff --git a/agent/micro_compaction.py b/agent/micro_compaction.py
index 73849829ccc..36faf29c1a0 100644
--- a/agent/micro_compaction.py
+++ b/agent/micro_compaction.py
@@ -207,8 +207,6 @@ class MicroCompactionMixin:
if not self._micro_compact_enabled:
return messages
- cursor_before = self._micro_compact_cursor
-
# Cadence gate: each pass breaks prompt cache once. Counted per invocation so a no-op turn
# can't wedge it.
every_n = max(1, int(self._micro_compact_every_n_turns or 1))
@@ -253,8 +251,6 @@ class MicroCompactionMixin:
updated_summary = self._micro_summarize_one(exchange_text)
if updated_summary is None:
_outcome = self._record_micro_failure(exchange_start, exchange_end)
- if _outcome != "exchange_skipped":
- self._micro_compact_cursor = cursor_before
_telemetry(_outcome, messages, tokens_after=_tokens_before, exchange_tokens=_exchange_tokens)
return messages
diff --git a/tests/agent/test_compressor_truncated_summary_guard.py b/tests/agent/test_compressor_truncated_summary_guard.py
index b74e9fa9302..0adff4d2390 100644
--- a/tests/agent/test_compressor_truncated_summary_guard.py
+++ b/tests/agent/test_compressor_truncated_summary_guard.py
@@ -254,6 +254,7 @@ class TestMicroSummarizeTruncationGuard:
)
c._micro_compact_enabled = True
messages = _msgs()
+ assert c._next_exchange(messages) is not None
cursor_before = c._micro_compact_cursor
refusal = "I’m sorry, but I can’t provide the requested summary."
response_content = f"<think>Check the applicable policy.</think>\n{refusal}"