fix(sessions): recover login-shell PATH so tmux works after reboot #184

Merged
dries merged 1 commit from fix/tool-path-after-reboot into main 2026-06-30 20:54:09 +02:00
Owner

Summary

  • After a reboot, ocman started by launchd/a login item inherits a minimal PATH that omits homebrew and version-manager (mise/asdf) shims. exec.LookPath for tmux/opencode/git then fails, so creating a session in an existing project errors with "No running OpenCode instance here, and tmux is unavailable to start one."
  • ensureToolPath() (new path_env.go) runs once at startup, asks the user's login shell for its PATH, and merges any missing entries into the process PATH before any LookPath runs. Best-effort; leaves PATH untouched on error.
  • Improved the frontend failure message to explain the cause and the fix instead of just "tmux is unavailable".

Testing

  • go test . (mergePath table test + reboot-simulation test that hides a binary behind a stripped PATH and asserts recovery)
  • pnpm exec vitest run src/lib/createSessionWithLaunch.test.ts
  • make lint
## Summary - After a reboot, ocman started by launchd/a login item inherits a minimal PATH that omits homebrew and version-manager (mise/asdf) shims. `exec.LookPath` for tmux/opencode/git then fails, so creating a session in an existing project errors with *"No running OpenCode instance here, and tmux is unavailable to start one."* - `ensureToolPath()` (new `path_env.go`) runs once at startup, asks the user's login shell for its PATH, and merges any missing entries into the process PATH before any `LookPath` runs. Best-effort; leaves PATH untouched on error. - Improved the frontend failure message to explain the cause and the fix instead of just "tmux is unavailable". ## Testing - `go test .` (mergePath table test + reboot-simulation test that hides a binary behind a stripped PATH and asserts recovery) - `pnpm exec vitest run src/lib/createSessionWithLaunch.test.ts` - `make lint`
fix(sessions): recover login-shell PATH so tmux works after reboot
All checks were successful
CI / Frontend (pull_request) Successful in 3m16s
CI / Backend (pull_request) Successful in 4m7s
CI / Playwright E2E (pull_request) Successful in 6m48s
CI / Coverage Ratchet (pull_request) Successful in 6m37s
CI / Build (pull_request) Successful in 5m25s
CI / Build Desktop (macOS arm64) (pull_request) Successful in 1m5s
CI / Semantic Tag (pull_request) Has been skipped
dacfd48fc3
When started by launchd/a login item after a reboot, ocman inherits a
minimal PATH that omits homebrew and version-manager (mise/asdf) shims,
so exec.LookPath for tmux/opencode/git fails and session launch errors
with 'tmux is unavailable'. Augment the process PATH from the user's
login shell at startup, and make the failure message explain the cause
and the fix.

Coverage ratchet: pass

Suite Baseline This PR Δ
go 69.50% 69.50% +0.00
frontend 58.30% 58.30% +0.00

Tolerance: -0.1%. Baseline stored on gh-pages.

<!-- coverage-ratchet --> ### Coverage ratchet: ✅ pass | Suite | Baseline | This PR | Δ | | |---|---|---|---|---| | go | 69.50% | 69.50% | +0.00 | ✅ | | frontend | 58.30% | 58.30% | +0.00 | ✅ | _Tolerance: -0.1%. Baseline stored on `gh-pages`._
dries merged commit 0c59868b7b into main 2026-06-30 20:54:09 +02:00
Sign in to join this conversation.
No description provided.