mirror of
https://github.com/garrytan/gbrain.git
synced 2026-07-30 03:12:32 +00:00
The wrapper script that 'gbrain autopilot --install' writes to ~/.gbrain/autopilot-run.sh sources ~/.bashrc to inherit PATH for the exec'd gbrain binary (which has a '#!/usr/bin/env bun' shebang). The standard Debian/Ubuntu ~/.bashrc ships a non-interactive guard that returns early when bash is launched non-interactively (cron, launchd, systemd) — so PATH exports operators add to ~/.bashrc never reach the wrapper subprocess. The result: the wrapper dies silently with 'env: bun: No such file or directory', leaves a stale lockfile, and every subsequent cron tick hits the lockfile and bails. The nightly dream cycle hangs waiting on a worker that never comes back, and the wrapper's own 10-min stale-lock window is the only thing that can recover it. This bites every operator whose bashrc is the standard distro default (which is the default), and there is no warning at install time. Fix: prepend ~/.bun/bin to PATH directly in the wrapper, so it is self-contained regardless of which init file the OS loaded. Add a regression test alongside the existing zshenv/zshrc source-order test (v0.36.1.x #966) so this class of bug stays caught.