mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 05:51:24 +00:00
refactor: consolidate throwIfAborted + fix isCompactionFailureError (#12463)
* refactor: consolidate throwIfAborted in outbound module - Create abort.ts with shared throwIfAborted helper - Update deliver.ts, message-action-runner.ts, outbound-send-service.ts * fix: handle context overflow in isCompactionFailureError without requiring colon
This commit is contained in:
@@ -50,16 +50,18 @@ export function isCompactionFailureError(errorMessage?: string): boolean {
|
||||
if (!errorMessage) {
|
||||
return false;
|
||||
}
|
||||
if (!isContextOverflowError(errorMessage)) {
|
||||
return false;
|
||||
}
|
||||
const lower = errorMessage.toLowerCase();
|
||||
return (
|
||||
const hasCompactionTerm =
|
||||
lower.includes("summarization failed") ||
|
||||
lower.includes("auto-compaction") ||
|
||||
lower.includes("compaction failed") ||
|
||||
lower.includes("compaction")
|
||||
);
|
||||
lower.includes("compaction");
|
||||
if (!hasCompactionTerm) {
|
||||
return false;
|
||||
}
|
||||
// For compaction failures, also accept "context overflow" without colon
|
||||
// since the error message itself describes a compaction/summarization failure
|
||||
return isContextOverflowError(errorMessage) || lower.includes("context overflow");
|
||||
}
|
||||
|
||||
const ERROR_PAYLOAD_PREFIX_RE =
|
||||
|
||||
Reference in New Issue
Block a user