From ae72abd019b25347bfc7593b5dcadc5a2cbc3786 Mon Sep 17 00:00:00 2001 From: Kaoru0822 Date: Mon, 5 Oct 2026 22:19:35 -0700 Subject: [PATCH] fix(cli): include build step in missing-runtime recovery --- scripts/rea.mjs | 2 +- tests/boundary/cli/dispatcher.test.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/rea.mjs b/scripts/rea.mjs index 8bc02dfe6..0d64bd552 100755 --- a/scripts/rea.mjs +++ b/scripts/rea.mjs @@ -23,7 +23,7 @@ const runtimeFiles = isMcpMode if (!(await compiledRuntimeExists(runtimeFiles))) { process.stderr.write( - `REA's compiled runtime is missing. Run \`npm ci\` in ${packageRoot} to install dependencies and build REA, then restart it. If this is an installed package, reinstall rea-agents.\n`, + `REA's compiled runtime is missing. Run \`npm ci && npm run build:cached\` in ${packageRoot} to install dependencies and build REA, then restart it. If this is an installed package, reinstall rea-agents.\n`, ); process.exitCode = 1; } else if (isMcpMode) { diff --git a/tests/boundary/cli/dispatcher.test.ts b/tests/boundary/cli/dispatcher.test.ts index 5236e9f86..7c0705405 100644 --- a/tests/boundary/cli/dispatcher.test.ts +++ b/tests/boundary/cli/dispatcher.test.ts @@ -83,9 +83,12 @@ describe("executable dispatcher", () => { expect(result).toMatchObject({ exitCode: 1, stderr: expect.stringContaining( - "REA's compiled runtime is missing. Run `npm ci` in", + "REA's compiled runtime is missing. Run `npm ci && npm run build:cached` in", ), }); + expect(result.stderr).toContain( + "If this is an installed package, reinstall rea-agents.", + ); expect(result).toMatchObject({ stderr: expect.not.stringContaining("ERR_MODULE_NOT_FOUND"), });