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:
max
2026-02-09 00:32:57 -08:00
committed by GitHub
parent f0924d3c4e
commit 79c2466662
6 changed files with 27 additions and 29 deletions

View File

@@ -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 =