Skip to content

fix(hosts): probe ~/.local/bin/codemux-remote when PATH lookup fails#44

Merged
Zeus-Deus merged 1 commit into
mainfrom
codemux-duplicate-install-prompt
May 27, 2026
Merged

fix(hosts): probe ~/.local/bin/codemux-remote when PATH lookup fails#44
Zeus-Deus merged 1 commit into
mainfrom
codemux-duplicate-install-prompt

Conversation

@Zeus-Deus
Copy link
Copy Markdown
Owner

Summary

  • "Test connection" was reporting NOT_INSTALLED immediately after a successful install, causing the UI to re-show the Install button on every press
  • Root cause: probe used command -v codemux-remote over a non-interactive SSH shell, but bootstrap installs to ~/.local/bin/codemux-remote — and most distros only put that dir on PATH via ~/.profile (login shells only)
  • Fall back to invoking \$HOME/.local/bin/codemux-remote directly when the PATH lookup misses; mirrors the absolute-path pattern already used by ensure_remote_binary_current and the tunnel supervisor's spawn command

Verification

  • New unit test build_probe_argv_falls_back_to_home_local_bin locks in BOTH the PATH lookup AND the absolute-path fallback so a future refactor can't silently drop either branch
  • All 6 ssh::probe tests pass
  • cargo check clean, tsc --noEmit clean, vitest 1766/1766 passing
  • End-to-end against a real host: with the binary installed at ~/.local/bin/codemux-remote and \$PATH=/usr/local/sbin:/usr/local/bin:/usr/bin (no ~/.local/bin), the new probe script returns CMR: {"name":"codemux-remote","protocol_version":1,"version":"0.7.1"} where the old script returned CMR: NOT_INSTALLED

Test plan

  • Install codemux-remote on a fresh host via the Devices panel
  • Press "Test now" — should report installed/connected instead of re-prompting to install
  • Confirm hosts where ~/.local/bin IS on the non-interactive PATH still take the fast (PATH lookup) branch
  • Confirm hosts without the binary still show "Reachable, but codemux-remote isn't installed yet"

The "Test connection" probe used `command -v codemux-remote` over a
non-interactive SSH shell, but bootstrap installs to
~/.local/bin/codemux-remote and most distros only add that dir to PATH
via ~/.profile (login shells), so the probe reported NOT_INSTALLED
immediately after a successful install and the UI re-showed the Install
button on every subsequent press.

Fall back to running $HOME/.local/bin/codemux-remote directly when the
PATH lookup misses, matching the absolute-path pattern already used by
ensure_remote_binary_current and the tunnel supervisor's spawn command.
@Zeus-Deus Zeus-Deus merged commit c404d50 into main May 27, 2026
2 checks passed
@Zeus-Deus Zeus-Deus deleted the codemux-duplicate-install-prompt branch May 27, 2026 18:38
Zeus-Deus added a commit that referenced this pull request May 27, 2026
- codex_adapter: route every wrapper-script `start_session` call
  through a new `start_session_resilient` helper that retries
  ETXTBSY ("Text file busy") from the kernel. Cause: tokio's
  fork+exec inherits sibling tests' in-flight write fds in the
  same test binary, and Linux's `i_writecount` check rejects the
  exec until the fd drains. Pure test-infra artifact — production
  spawns a pre-installed `codex` binary. 25/25 stress runs clean.

- new-workspace-dialog: widen the chip-assertion `waitFor` to 5s.
  Windows CI under load stretches paste → mock → setAttachments →
  commit past the default 1s; Linux/macOS resolve well under 100ms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant