Files
openbot/scripts
Aleksander DygońandClaude Opus 5.5 30781fe605 Stop automatic compactions after 2 failures in a row (#5302)
A Codex compaction that failed set no limit. The next turn grew the
chat past the growth rule, and OpenBot asked for a new compaction.
One chat compacted every 19 seconds for 7 hours and used up the
ChatGPT plan limit.

Count the compactions that fail, that Codex refuses, that a handoff
cannot do, or that the deadline stops. After 2 in a row, OpenBot asks
for no more automatic compactions of that session and shows one
notice. A completed compaction, or a session below 80% of its window,
starts the count again. "Compact now" still works.

The deadline now also sets the last compacted size. Before, the next
message asked for a new compaction while Codex still ran the one that
ignored the stop. This failed the "refused start" case of the
compaction queue E2E on main.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 10:11:54 +01:00
..