Repository navigation
Description
Summary
Homebrew replaced Node while BB was running. The enrolled Mac mini stayed connected, but Codex and Claude Code model discovery failed because BB tried to spawn the removed executable. Restarting the complete BB service restored both providers.
Versions and environment
- BB:
0.45.0(latest release when investigated), installed throughinstall-machine.shon a remote enrolled machine. - OS/runtime: macOS
26.7.1(25G241), arm64; Homebrewnode@24, Node24.21.0. Package revision changed from_1to_2. - Providers: Codex
0.162.0, Claude Code2.1.293(versions collected after recovery). - Service executable:
/opt/homebrew/opt/node@24/bin/node— already a stable alias. Daily Homebrew autoupdate upgrades formulae.
Steps to reproduce
-
Run an enrolled BB machine through Homebrew's stable Node alias.
-
Leave BB running while Homebrew upgrades Node and removes the previous Cellar executable.
-
Query both model catalogs, replacing the example host ID:
bb provider models codex --machine host_inp9jikk4s --json bb provider models claude-code --machine host_inp9jikk4s --json
-
Restart the complete BB service and repeat: both catalogs load again.
Safe mechanism reproduction: save the folded script below as node-runtime-path-repro.mjs in a writable scratch directory and run node node-runtime-path-repro.mjs. It retargets a symlink between byte-identical Node copies and removes only its own old copy. Passed on the mini's Node 24.21.0 and standalone Node 22.23.2; this is a spawn/fork fixture, not a full BB integration test.
Self-contained reproduction script
import assert from 'node:assert/strict';
import { fork, spawnSync } from 'node:child_process';
import { constants, copyFileSync, existsSync, mkdirSync, mkdtempSync, realpathSync, rmSync, symlinkSync, unlinkSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
const self = fileURLToPath(import.meta.url);
function forkResult(execPath) {
return new Promise((resolve) => {
const options = { silent: true, ...(execPath === undefined ? {} : { execPath }) };
const child = fork(self, ['worker'], options);
let message;
child.on('message', (value) => { message = value; });
child.once('error', (error) => resolve(error.code));
child.once('exit', (code) => resolve(code === 0 && message === 'worker started' ? 'ok' : `exit ${code}`));
});
}
if (process.argv[2] === 'worker') {
process.send('worker started');
process.disconnect();
} else if (process.argv[2] === 'parent') {
const [stable, replacement] = process.argv.slice(3);
const childArgs = ['-p', 'JSON.stringify({version:process.version,abi:process.versions.modules,arch:process.arch})'];
const baseline = spawnSync(process.execPath, childArgs, { encoding: 'utf8' });
assert.equal(baseline.status, 0);
console.log(`baseline: ${baseline.stdout.trim()}`);
console.log(`original invocation retained stable alias: ${process.argv0 === stable}`);
const descendantAlias = spawnSync(process.execPath, ['-p', 'process.argv0'], { encoding: 'utf8' });
assert.equal(descendantAlias.stdout.trim(), process.execPath);
console.log('launching a child via process.execPath loses the stable alias');
unlinkSync(stable);
symlinkSync(replacement, stable);
unlinkSync(process.execPath);
const stale = spawnSync(process.execPath, childArgs, { encoding: 'utf8' });
assert.equal(stale.error?.code, 'ENOENT');
console.log(`saved executable after removal: ${stale.error.code}`);
const recovered = spawnSync(stable, childArgs, { encoding: 'utf8' });
assert.equal(recovered.status, 0);
assert.equal(recovered.stdout, baseline.stdout);
console.log(`stable executable: ${recovered.stdout.trim()}`);
assert.equal(await forkResult(), 'ENOENT');
assert.equal(await forkResult(stable), 'ok');
console.log('fork() default: ENOENT; fork() with stable execPath: ok');
console.log('PASS: the parent survives; identical replacement restores child launches');
} else {
const root = mkdtempSync(join(dirname(self), 'node-runtime-fixture-'));
const original = join(root, 'original/bin/node');
const replacement = join(root, 'replacement/bin/node');
const stable = join(root, 'stable-node');
try {
for (const target of [original, replacement]) {
mkdirSync(dirname(target), { recursive: true });
copyFileSync(process.execPath, target, constants.COPYFILE_FICLONE);
const sourceLib = join(dirname(process.execPath), '../lib');
if (existsSync(sourceLib)) symlinkSync(realpathSync(sourceLib), join(dirname(target), '../lib'), 'dir');
}
symlinkSync(original, stable);
const result = spawnSync(stable, [self, 'parent', stable, replacement], { stdio: 'inherit', timeout: 15000 });
if (result.error) throw result.error;
assert.equal(result.status, 0);
} finally {
rmSync(root, { recursive: true, force: true });
}
}Expected vs actual
Expected: new provider workers use an available compatible runtime after replacement, or BB reports a specific runtime recovery action.
Actual: host remains connected; Codex returns:
Could not load models for codex (missing_executable)
Provider "codex" failed to start: spawn /opt/homebrew/Cellar/node@24/24.21.0_1/bin/node ENOENT
[]
Claude Code fails on the same path. No provider reinstall or authentication change was needed to recover.
Evidence
- Release runtime.ts:318 captures
process.execPath; provider-registry.ts:35 uses it as the worker command. Node resolves symlinks in execPath, so the stable alias becomes a removable Cellar path. The installed bundle contains these expressions. - The fixture confirms: old
execPath→ENOENT; stable alias → success; defaultfork()→ENOENT; explicit stableexecPath→ success. Intermediate launches throughexecPathalso lose the stable alias. - The supervisor and plugin-worker launches need auditing; additional plugin failures were not observed.
- Live failure verified on release
129f621; main9a47d42retains the expression, but full BB integration was not rerun on main. Investigation: @thread:thr_z9zqs4r64h; machinehost_inp9jikk4s.
Solution comparison
| Option | Assessment |
|---|---|
| Preserve stable runtime reference; validate replacement | Recommended. Carry the reference through launchers and workers; recover compatible launches without interrupting existing agents. |
| Detect replacement and restart BB | Repairs this incident, but a full restart can interrupt active agents; restarting only a child leaves its supervisor's stale path. |
| BB-managed Node distribution | Controls runtime lifetime, but adds packaging, security updates, native-addon and shared-library responsibilities. Copying Homebrew's binary alone is insufficient. |
| Pin Node / coordinate upgrades | Workaround; leaves ongoing maintenance with the user. |
Acceptance criteria: regression coverage for symlink retargeting/removal; compatibility and startup validation; actionable errors for unavailable/incompatible runtimes. Preserve empty-PATH GUI and Electron behavior from PR #257. Simply switching to node on PATH would regress that fix. Distinguish missing BB runtime from missing provider CLI or working directory.
What you ruled out
- A Node version change is unnecessary: the fixture uses identical binaries; the incident changed only the Homebrew revision.
- Incorrect launchd path: the service already used the stable alias.
- No matching report found in open/closed issue and PR searches for Homebrew, Cellar, execPath/ENOENT, missing_executable, and Node upgrades. Related #2343 concerns GUI PATH; #3166 concerns provider CLI update ownership; #3207 concerns a startup registry race.
Suggested priority and effort
Medium: provider workers cannot start until a full service restart; no data loss observed. Effort depends on runtime selection and launcher propagation.
Written by Codex
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 9, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilothost,providers.confirmed-repro.process.execPathand uses the removed filename for new provider workers after the stable alias changes.ENOENTin two clean trusted-main checkouts at635711463. Existing workers and fresh-runtime recovery both succeed; 38 adjacent tests pass. Linux scripted-provider verification, not a live enrolled-Mac/Codex/Claude integration.ariofrio commentedon Oct 16, 2026
Broader impact: this affects new Node-dependent subprocesses on the affected runtime, beyond provider model discovery. A connected host and surviving workers can conceal the failure until another child must start.
Reproduced
turn.submitwithProvider "codex" failed to start: spawn /opt/homebrew/Cellar/node@24/24.21.0_2/bin/node ENOENT. Read-only checks confirmed that file was gone and the stable alias now resolved to Node24.22.0. This is a recurrence after another Node replacement.22.23.2, I exercised the actual Browser Automationsupervise()helper and watchercreateForkChannel()helper. Both new launches returnedENOENTafter removal; retained children and direct shell/native launches still worked. Helper-level verification: the browser target was/bin/sleepand the watcher child an IPC stub, not full Chrome/Parcel/UI integration.Additional scope established by source
Audit pinned to
4c87fdec7b7effc022ff2ee31ec95c0a09c9ee62; these complete user flows were not separately reproduced:fork(). An otherwise-running agent can therefore encounter failures when invoking a plugin.Boundaries and routing
host,providers, andconfirmed-repro, and addingpluginsandworkspacesfor routing.confirmed-reproshould not imply every downstream flow above has been integration-tested. A fix should cover the shared runtime-lifetime assumption across launchers and workers.Written by Codex
One host toolchain for executable discovery, child PATH, and proxy/CA…