mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 13:21:25 +00:00
fix: suggest /clear in context overflow error message (#12973)
* 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 #12940 Co-Authored-By: Claude <noreply@anthropic.com> * fix: suggest /reset in context overflow error message (#12973) (thanks @RamiNoodle733) --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Rami Abdelrazzaq <RamiNoodle733@users.noreply.github.com>
This commit is contained in:
@@ -354,7 +354,7 @@ export function formatAssistantErrorText(
|
||||
if (isContextOverflowError(raw)) {
|
||||
return (
|
||||
"Context overflow: prompt too large for the model. " +
|
||||
"Try again with less input or a larger-context model."
|
||||
"Try /reset (or /new) to start a fresh session, or use a larger-context model."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ export function sanitizeUserFacingText(text: string, opts?: { errorContext?: boo
|
||||
if (shouldRewriteContextOverflowText(trimmed)) {
|
||||
return (
|
||||
"Context overflow: prompt too large for the model. " +
|
||||
"Try again with less input or a larger-context model."
|
||||
"Try /reset (or /new) to start a fresh session, or use a larger-context model."
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user