mirror of
https://github.com/bitbaum/openclaw.git
synced 2026-12-04 08:32:51 +01:00
fix(auto-reply): preserve sessions after compaction failures (#70479)
Summary: - The PR removes the auto-reply compaction-failure session reset hook, adds preserved-session recovery guidance for overflow/compaction failure paths, and updates focused tests, docs, and the changelog. - Reproducibility: yes. at source level with high confidence. Current main routes both embedded overflow paylo ... resetSessionAfterCompactionFailure, and the PR body includes before/after terminal proof of those branches. Automerge notes: - PR branch already contained follow-up commit before automerge: fix(auto-reply): drop dead compaction reset hook - PR branch already contained follow-up commit before automerge: fix(auto-reply): preserve sessions after compaction failures Validation: - ClawSweeper review passed for head 193d3c0fdd5a42cc5291f4f279e80f872fdd1051. - Required merge gates passed before the squash merge. Prepared head SHA: 193d3c0fdd5a42cc5291f4f279e80f872fdd1051 Review: https://github.com/openclaw/openclaw/pull/70479#issuecomment-4325128777 Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com> Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com> Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com> Approved-by: takhoffman Co-authored-by: takhoffman <781889+takhoffman@users.noreply.github.com>
This commit is contained in:
5 files changed
+147
-91
No files matched your search
@@ -274,6 +274,11 @@ In the embedded Pi agent, auto-compaction triggers in two cases:
|
||||
number of tokens`, `input token count exceeds the maximum number of input
|
||||
tokens`, `input is too long for the model`, `ollama error: context length
|
||||
exceeded`, and similar provider-shaped variants) → compact → retry.
|
||||
If overflow recovery still fails, OpenClaw surfaces explicit guidance to the
|
||||
user and preserves the current session mapping instead of silently rotating
|
||||
the session key to a fresh session id. The next step is operator-controlled:
|
||||
retry the message, run `/compact`, or run `/new` when a fresh session is
|
||||
preferred.
|
||||
2. **Threshold maintenance**: after a successful turn, when:
|
||||
|
||||
`contextTokens > contextWindow - reserveTokens`
|
||||
|
||||
Reference in new issue
Block a user