diff --git a/packages/cli/src/run.ts b/packages/cli/src/run.ts index 3d6015af11..b7affd2639 100644 --- a/packages/cli/src/run.ts +++ b/packages/cli/src/run.ts @@ -26,6 +26,7 @@ import { GENAI_ANY_REGEX, TRACE_CHUNK, UNRECOVERABLE_ERROR_CODES, + SUCCESS_ERROR_CODE, } from "../../core/src/constants" import { isCancelError, errorMessage } from "../../core/src/error" import { Fragment, GenerationResult } from "../../core/src/generation" @@ -86,7 +87,11 @@ export async function runScriptWithExitCode( for (let r = 0; r < runRetry; ++r) { const res = await runScript(scriptId, files, options) exitCode = res.exitCode - if (UNRECOVERABLE_ERROR_CODES.includes(exitCode)) break + if ( + exitCode === SUCCESS_ERROR_CODE || + UNRECOVERABLE_ERROR_CODES.includes(exitCode) + ) + break const delayMs = 2000 * Math.pow(2, r) console.error( diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index b8b1d65b07..5f4c4005e2 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -87,7 +87,6 @@ export const USER_CANCELLED_ERROR_CODE = -7 export const CONFIGURATION_ERROR_CODE = -8 export const UNRECOVERABLE_ERROR_CODES = Object.freeze([ - 0, CONNECTION_CONFIGURATION_ERROR_CODE, USER_CANCELLED_ERROR_CODE, FILES_NOT_FOUND_ERROR_CODE,