Files
openclaw/docs
Kris Wu 444a093593 fix(agents): skip pre-prompt precheck when context engine owns compaction (#95342)
* fix(agents): skip pre-prompt precheck when context engine owns compaction

When a context engine advertises ownsCompaction=true (e.g. lossless-claw),
skip the pre-prompt preemptive overflow precheck entirely. The engine
already manages the context budget through assemble() and its own
compaction lifecycle — the built-in precheck is redundant and causes
false-positive overflow errors for CJK-heavy sessions due to its
conservative token estimation formula.

Safety is preserved: if the model's actual context limit is exceeded,
the model API returns an error that the outer overflow-compaction retry
loop handles normally.

* fix(agents): assert non-null context engine in precheck skip log

* test(context-engine): cover owning precheck contract

* fix(agents): preserve precheck after context assembly failure

---------

Co-authored-by: Josh Lehman <josh@martian.engineering>
2026-06-30 00:55:03 -07:00
..