fix: suggest /clear in context overflow error message#12973
fix: suggest /clear in context overflow error message#12973Takhoffman merged 2 commits intoopenclaw:mainfrom
Conversation
Takhoffman
left a comment
There was a problem hiding this comment.
Thanks for tackling this. The actionable-recovery idea is right, but /clear is not a built-in chat command in OpenClaw today.
BLOCKER
- The new message recommends
Try /clear to reset session history..., but session reset is/reset(or/new)./cleardoes not exist by default, so this would leave users stuck.- Docs list
/resetand/new(seedocs/tools/slash-commands.md). - Command registry defines
/resetand/new(seesrc/auto-reply/commands-registry.data.ts).
- Docs list
Please update the wording to recommend /reset (and optionally /new) instead of /clear.
Optional alternative (bigger scope): actually add /clear as an alias/default reset trigger across channels and update docs.
Also note: GitHub reports this PR as merge-conflicting (mergeable: CONFLICTING), so it likely needs a rebase/resolve.
055cfb6 to
5201b77
Compare
|
I rebased onto current main, resolved the conflicts, and updated the message to recommend Pushed update to
Local verification:
Prep notes: |
5201b77 to
14e786d
Compare
When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com>
14e786d to
d5ad76e
Compare
Takhoffman
left a comment
There was a problem hiding this comment.
Rebased onto current main and fixed the recovery guidance to recommend /reset (and mention /new) instead of /clear. Updated tests and ran local gates (build/check/test).
Takhoffman
left a comment
There was a problem hiding this comment.
Rebased onto current main and fixed the recovery guidance to recommend /reset (and mention /new) instead of /clear. Updated tests and ran local gates (build/check/test).
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com> (cherry picked from commit c2b2d53) # Conflicts: # src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.ts # src/agents/pi-embedded-helpers/errors.ts
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com> (cherry picked from commit c2b2d53) # Conflicts: # src/agents/pi-embedded-helpers.sanitizeuserfacingtext.test.ts # src/agents/pi-embedded-helpers/errors.ts
* fix: suggest /reset in context overflow error message When the context window overflows, the error message now suggests using /reset to clear session history, giving users an actionable recovery path instead of a dead-end error. Closes openclaw#12940 * fix: suggest /reset in context overflow error message (openclaw#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
Summary
Update the context overflow error message to suggest using /clear to reset session history, which immediately resolves the issue for users stuck in an overflow loop.
Problem
When the context window overflows, the error message was:
This left users stuck — especially when receiving the error via messaging channels (Telegram, etc.) where they couldn't easily troubleshoot:
Fix
Changed the error message to:
Files Changed
Closes #12940
Greptile Overview
Greptile Summary
This PR updates the user-facing “context overflow” error text in the embedded Pi agent stack to recommend using
/clearto reset session history, instead of only suggesting reducing input or switching to a larger-context model.The change is applied in both the generic error formatting helpers (
formatAssistantErrorText()andsanitizeUserFacingText()) and in the embedded runner’s context overflow handling path, keeping messaging consistent across the helper-based formatting and the runner-level early return.Confidence Score: 5/5
Context used:
dashboard- CLAUDE.md (source)dashboard- AGENTS.md (source)