The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(rea): resolve REA's dependencies as of LU's check, keep npm's warnings out of the server log
purple5f966ce59822
diff --git a/src/api/mcp/external-client.ts b/src/api/mcp/external-client.tsindex 17fe7e87..2038113b 100644--- a/src/api/mcp/external-client.ts+++ b/src/api/mcp/external-client.ts@@ -127,6 +127,17 @@ export const HANDSHAKE_CAP_MS = 10 * 60_000* while uvx or npx is still fetching the server. */export const INSTALLING_NOTE = 'Installing server dependencies … the first start can take a few minutes.'+/**+ * Whether a stderr chunk is only npm talking while npx installs the server+ * ("npm warn deprecated [email protected] …"). That is no error of the+ * server's, and as a WARN in the log it read like one (marky_7777,+ * 07.11.2026). A chunk with any other line in it stays a warning.+ */+export function isNpmNotice(data: string): boolean {+ const lines = data.split(/\r?\n/).map((l) => l.trim()).filter(Boolean)+ return lines.length > 0 && lines.every((l) => /^npm (warn|notice)\b/i.test(l))+}+/*** How much longer the handshake waits, or null when it gives up: the server* has been quiet for `quietMs`, or the whole handshake reached `capMs`.@@ -291,7 +302,8 @@ export class MCPExternalClient {})command.stderr.on('data', (data: string) => {- log.warn(`[MCP:${this.config.name}] stderr`, { data })+ if (isNpmNotice(data)) log.info(`[MCP:${this.config.name}] npm`, { data })+ else log.warn(`[MCP:${this.config.name}] stderr`, { data })this.lastOutputAt = Date.now()if (!this.registered) this.onProgress?.(INSTALLING_NOTE)})diff --git a/src/lib/plugins/__tests__/rea-resolves-what-lu-checked.test.ts b/src/lib/plugins/__tests__/rea-resolves-what-lu-checked.test.tsnew file mode 100644index 00000000..1addc75c--- /dev/null+++ b/src/lib/plugins/__tests__/rea-resolves-what-lu-checked.test.ts@@ -0,0 +1,72 @@+/**+ * marky_7777, 07.11.2026: LU's log showed+ * `WARN ui: [MCP:REA] stderr {"data":"npm warn deprecated [email protected] …`.+ *+ * REA's tarball is pinned and checked (commands/plugin_rea.rs), and its own+ * dependencies are exact versions. Theirs are ranges, and npx resolved them on+ * each first start: the start on this Mac on 27.10. pulled @babel/helper-string-parser+ * 8.0.8, fast-uri 3.1.9, jose 6.2.13 and node-abi 3.101.0, all newer than what+ * existed when LU checked REA. prebuild-install comes with Frida's optional+ * package; install scripts are off, so it is fetched and never run.+ *+ * Now every range resolves to what existed on LU's check date, and npm's own+ * warnings are neither printed by REA's npx nor kept as a WARN of the server.+ *+ * Run: npx vitest run src/lib/plugins/__tests__/rea-resolves-what-lu-checked.test.ts+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import { dirname, resolve } from 'node:path'+import { REA_RESOLVE_BEFORE, reaServerConfig, type ReaStatus } from '../rea'+import { isNpmNotice } from '../../../api/mcp/external-client'++const ready: ReaStatus = {+ version: '6.5.0',+ ready: true,+ tarball: '/data/plugins/rea/rea-agents-6.5.0.tgz',+ workDir: '/data/plugins/rea/work',+ path: null,+ node: 'v24.11.0',+ nodeOk: true,+ nodeRange: '22.19 or newer within 22, 24.11 or newer within 24, or 26 and later',+}++describe("REA's dependencies resolve to what LU checked", () => {+ it('npm may pick nothing published after the check date', () => {+ const env = reaServerConfig(ready).env ?? {}+ expect(env.npm_config_before).toBe(REA_RESOLVE_BEFORE)+ // After REA 6.5.0 came out (14.10.2026), before the next one (18.10.2026).+ const t = Date.parse(REA_RESOLVE_BEFORE)+ expect(t).toBeGreaterThan(Date.parse('2026-10-14T12:56:14Z'))+ expect(t).toBeLessThan(Date.parse('2026-10-18T08:12:05Z'))+ expect(env.npm_config_ignore_scripts).toBe('true')+ })++ it('the cutoff names the REA version it was set for', () => {+ const here = dirname(fileURLToPath(import.meta.url))+ const rust = readFileSync(resolve(here, '../../../../src-tauri/src/commands/plugin_rea.rs'), 'utf8')+ expect(rust).toContain('pub const REA_VERSION: &str = "6.5.0";')+ })++ it("npm's warnings stay off REA's stderr", () => {+ expect(reaServerConfig(ready).env?.npm_config_loglevel).toBe('error')+ })+})++describe('npm talking on a server stderr is no server warning', () => {+ it('the line from the report', () => {+ expect(isNpmNotice('npm warn deprecated [email protected]: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.\n')).toBe(true)+ })++ it('several npm lines, Windows line ends, older casing', () => {+ expect(isNpmNotice('npm WARN deprecated [email protected]: x\r\nnpm notice New minor version of npm available\r\n')).toBe(true)+ })++ it('anything else in the chunk keeps it a warning', () => {+ expect(isNpmNotice('npm warn deprecated [email protected]: x\nError: Cannot find module frida\n')).toBe(false)+ expect(isNpmNotice('npm error code E404\n')).toBe(false)+ expect(isNpmNotice('{"level":40,"msg":"ghidra not found"}\n')).toBe(false)+ expect(isNpmNotice('\n')).toBe(false)+ })+})diff --git a/src/lib/plugins/rea.ts b/src/lib/plugins/rea.tsindex 26b6860b..d0573757 100644--- a/src/lib/plugins/rea.ts+++ b/src/lib/plugins/rea.ts@@ -25,6 +25,13 @@ export const REA_PLUGIN = {npm: 'rea-agents',} as const+/**+ * The newest publish date npm may pick for anything REA pulls in. REA 6.5.0+ * came out on 14.10.2026, LU checked it on 17.10.2026. A new REA version moves+ * this together with REA_VERSION and REA_INTEGRITY (commands/plugin_rea.rs).+ */+export const REA_RESOLVE_BEFORE = '2026-10-17T00:00:00.000Z'+/*** How long REA's first `initialize` may take. `npx` installs REA's pinned* dependencies before the server answers, and on the first start that is a@@ -163,6 +170,14 @@ export function reaServerConfig(status: ReaStatus): MCPServerConfig {if (why) throw new Error(why)const env: Record<string, string> = {npm_config_ignore_scripts: 'true',+ // The tarball pins REA's own dependencies exactly; theirs are ranges, and+ // npm resolved them on each user's first start (marky_7777, 07.11.2026:+ // the start of 27.10. pulled four packages newer than LU's check). With a+ // cutoff every range resolves to what existed when LU checked REA.+ npm_config_before: REA_RESOLVE_BEFORE,+ // npm's own warnings (prebuild-install is deprecated, it comes with Frida's+ // optional package and never runs here) are no errors of REA's.+ npm_config_loglevel: 'error',npm_config_update_notifier: 'false',npm_config_fund: 'false',npm_config_audit: 'false',