From d103eaab0097515daab995fb3101fd25552cec0a Mon Sep 17 00:00:00 2001 From: Codex Date: Mon, 26 Oct 2026 16:41:26 +0000 Subject: [PATCH] refactor(deep-scan): strip the compaction prefix in one step --- plugins/codex-security/mcp-app/src/deep-scan/errors.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugins/codex-security/mcp-app/src/deep-scan/errors.ts b/plugins/codex-security/mcp-app/src/deep-scan/errors.ts index 559cf7c58..0842ecc3d 100644 --- a/plugins/codex-security/mcp-app/src/deep-scan/errors.ts +++ b/plugins/codex-security/mcp-app/src/deep-scan/errors.ts @@ -31,14 +31,9 @@ const USAGE_LIMIT_MESSAGES = new Set([ "You hit your spend cap set by the owner of your workspace. Ask an owner to increase your spend cap to continue.", ]); -// Codex reports failures from remote context compaction with this prefix. -const REMOTE_COMPACTION_ERROR_PREFIX = "Error running remote compact task: "; - // Codex exec exposes only text for failed turns. Match its native quota messages here. export function codexWorkerTurnError(message: string): Error { - const reason = message.startsWith(REMOTE_COMPACTION_ERROR_PREFIX) - ? message.slice(REMOTE_COMPACTION_ERROR_PREFIX.length) - : message; + const reason = message.replace(/^Error running remote compact task: /, ""); if ( USAGE_LIMIT_MESSAGES.has(reason) || reason.startsWith("You’ve hit your usage limit.") ||