---
digest: >
  v0.39.1 is a patch release about one failure: a Pi opened where `node` is not on the
  PATH, which a desktop launch or a window older than the Node install gives it. Through
  v0.39.0 that Pi exited at startup with `spawn node ENOENT`. PR #47 (Rodrigo Immaginario)
  keeps it up, and CR191 makes the Pi extension find Node where the hook wrappers already
  look, so a machine with a global install needs nothing configured; when no Node resolves,
  the session says so once, with the fix, and `runtime diagnose` can see it. No migration,
  and no model or prompt change.
---

# v0.39.1 — Pi Finds Its Node, or Says So

**Date:** 2026-11-02

## Highlights

- **A Pi opened without `node` on its PATH no longer exits**
  ([PR #47](https://github.com/mirror-mind-ai/mirror/pull/47), by @rodrigoimmaginario). The
  extension's detached maintenance process had no `'error'` listener, so a `node` that
  could not start was an uncaught exception and Pi went down with it. It is now logged.
- **The Pi extension resolves Node the way the hook wrappers do**
  ([CR191](../project/refinement/rs010-cv22-oracle-and-port-hygiene/cr191-the-pi-extension-cannot-find-node-where-the-hook-wrappers-can.md)):
  `MIRROR_NODE`, the PATH, the Node that installed the package (`<prefix>/bin/node`), then
  `~/.nvm/current/bin`, `/opt/homebrew/bin`, `/usr/local/bin`. On a machine with a global
  install this needs no configuration: the session that used to crash opens as usual.
- **When no Node resolves, the failure reaches someone.** Pi stays up, shows one warning at
  session start that names the fix (`MIRROR_NODE=/path/to/node`, Node 24 or later), and
  writes one line to `<mirror home>/hooks.log`, where `mirror runtime diagnose` reports it
  for seven days as `hook_failures_recorded`, as it does for the other runtimes' hooks.
- **A `MIRROR_NODE` the extension will not use is warned once, with the reason**: missing, a
  directory, not executable, or relative. The search goes on without it.
- No migration, and no model or prompt change.

## Where We Started

On 2026-10-16 a Pi opened from a terminal window whose PATH predated the Node install
exited at once:

```text
pi exiting due to uncaughtException:
Error: spawn node ENOENT
  spawnargs: [ '…/node_modules/mirror-mind/bin/mirror.js', 'conversation-logger', 'session-maintenance' ]
```

The same happens wherever `node` is not on the PATH Pi inherited, and `runtime diagnose`
had long named that the usual case for a runtime launched from the desktop: `node` lives
under nvm or Homebrew, not where a GUI looks. The hook wrappers the other runtimes use
were built for exactly this. They search the usual places and record a failure in
`hooks.log`. The Pi extension, which runs no wrapper, knew only the bare name `node`.

Rodrigo Immaginario's PR #47 fixed the crash: the listener, and `MIRROR_NODE` honored by
the extension as the wrappers honor it. Reviewed through four lenses on 2026-11-01, it was
merged as it was. The review also showed what it left: without `MIRROR_NODE`, that Pi now
ran with Mirror silently absent, no welcome card, no logging, no context, and a line in a
file no one is pointed at. That is the failure the wrappers' silence-is-forbidden rule was
written against, and CR191 is its answer for Pi.

## What Changed

**One resolver, the wrappers' order (CR191).** The extension resolves Node itself, in the
same order the wrappers use, taking only an executable file: `MIRROR_NODE`, then `node` on
each PATH entry, then the `bin/` of the prefix the package is installed under, three
directories up from the tree the extension ships in, which is the Node that installed the
package, then nvm, Homebrew, `/usr/local`. The candidate list is the core's
`HOOK_NODE_CANDIDATES`, duplicated in the extension because it imports no core module, and a
test fails if the two ever differ, as one already did for the wrappers. On Windows the
search stops after the PATH, as before.

**Nothing found: no spawn, one notice, one line.** When no Node resolves, no front-door
process is attempted: each call logs that it was skipped. At session start, the extension
says so once, the way it already says `mirror` is not on the PATH:

```text
Mirror: `node` is not on the PATH Pi inherited, nor in the usual places — set MIRROR_NODE=/path/to/node (Node 24 or later) where Pi is launched. Mirror will not log this session.
```

and writes one line to `hooks.log` in the wrappers' format, `pi:session-start: node not
found on PATH or in the usual places; …`, which `runtime diagnose` counts.

**The log tells one story.** A child that did not start is not logged as started; one that
exits non-zero leaves its code beside its own output. PR #47's listener stays as the record
of a file that vanished between the check and the spawn.

Validated against Pi 1.5.0 with `PATH=/usr/bin:/bin`, the incident's configuration: the
session opened through `/opt/homebrew/bin/node` with nothing configured; a bad
`MIRROR_NODE` was warned once; with no Node anywhere, Pi stayed up, the warning was on
screen, and `runtime diagnose` reported the `hooks.log` line.

## Conscious Exclusions

- The hook wrappers and the MCP locator still accept a relative `MIRROR_NODE`; the Pi
  extension refuses one, since it would resolve against whatever project Pi was opened in.
  Whether the family follows is a separate decision.
- A "Node too old" message with the version, as the wrappers print: the exit code and the
  loader's own output are in the log.
- Windows candidates beyond `MIRROR_NODE` and the PATH.

## Upgrading

```bash
mirror runtime update
```

A Pi session running the previous extension keeps it until Pi restarts.

## Next Horizon

CR190, captured this week, and the open RS010 backlog. CV24 continues on its branch.
