Files
gbrain/src/core
Garry TanandClaude Fable 5 12a585ca52 fix(jobs/autopilot): worker liveness pre-flight, installer PATH, give-up exit codes, direct-pool config plane
Four backlog fixes in the jobs/autopilot workers, locks & installers area:

- #1868: autopilot --install wrapper script now bakes the install-time
  runtime dirs (gbrain's dir, the running runtime's dir, ~/.bun/bin) onto
  PATH after profile sourcing, so a bun-shebang gbrain no longer
  crash-loops under systemd's minimal PATH. Pure generateWrapperScript()
  exported for tests.

- #2116: runRemediation (onboard --auto / doctor --remediate / MCP
  run_onboard) runs a worker-liveness pre-flight on the Postgres path
  before submitting steps: local worker registry OR active-job live-lock
  DB proxy. No worker -> fail fast with a start-a-worker hint (exit 1)
  instead of burning every step's full timeout in silence.
  GBRAIN_REMEDIATION_ASSUME_WORKER=1 escape hatch; probe failures fail open.

- #2234 (part 2): autopilot give-up paths (max_crashes,
  cycle-failure-cap) now exit non-zero via shutdownExitCode() so systemd
  Restart=on-failure restarts a daemon that decided it can't make
  progress. SIGTERM/SIGINT stay 0.

- #2731: GBRAIN_DISABLE_DIRECT_POOL gets a config.json plane
  (pool.disable_direct) read when the env var is unset; env wins in both
  directions when set (pace-mode precedence). Daemons/launchd/cron that
  don't inherit the shell env can now persist the kill-switch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 14:37:08 -07:00
..