Context
PR #15 added an auto-update mechanism: every push compares the laptop's `codemux-remote` version against the host's, and re-bootstraps if they differ (`ensure_remote_binary_current` in `src-tauri/src/commands/hosts.rs` line 1055).
Production users get this for free. Whenever Codemux's version bumps, the next push to any host auto-updates the remote binary.
Dev users are stuck. When you're iterating on `codemux-remote` code in a dev branch, the version string stays the same (`0.3.1`) across rebuilds, so the version check sees a match and skips the update. The remote keeps running the old binary. Currently the only workaround is:
```bash
scp src-tauri/target/debug/codemux-remote deus@host:~/.local/bin/
ssh deus@host 'pkill -f "codemux-remote pty-daemon"'
```
(This is exactly what bit us through the entire PR #15 debugging marathon — multiple "the bug isn't fixed" loops were really "the host is running an old binary.")
What's needed
A "Reinstall agent on host" button in Settings → Hosts that:
- Reuses the existing `hosts_bootstrap_install` Tauri command (`src-tauri/src/commands/hosts.rs` line 227) — it already does scp + chmod + verify
- ALSO sends `pkill -f "codemux-remote pty-daemon"` on the host so the new binary takes effect immediately
- Shows a small success/error toast (already a pattern in the hosts pane)
Where in the UI
`src/components/settings/hosts-section.tsx` — each host row already has buttons (Test connection, Edit, Delete or similar). Add "Reinstall agent" next to or under the existing actions.
Acceptance criteria
- Dev rebuilds `codemux-remote` (`cargo build --bin codemux-remote`)
- Clicks "Reinstall agent on host" in Settings
- Next push uses the freshly-built binary
- No manual scp needed
Out of scope
- Auto-detecting dev mode and bumping a build timestamp (separate, larger refactor)
- A bulk "reinstall on all hosts" action (per-host is enough)
Estimate
~1 hour. Mostly UI plumbing; backend command already exists.
Context
PR #15 added an auto-update mechanism: every push compares the laptop's `codemux-remote` version against the host's, and re-bootstraps if they differ (`ensure_remote_binary_current` in `src-tauri/src/commands/hosts.rs` line 1055).
Production users get this for free. Whenever Codemux's version bumps, the next push to any host auto-updates the remote binary.
Dev users are stuck. When you're iterating on `codemux-remote` code in a dev branch, the version string stays the same (`0.3.1`) across rebuilds, so the version check sees a match and skips the update. The remote keeps running the old binary. Currently the only workaround is:
```bash
scp src-tauri/target/debug/codemux-remote deus@host:~/.local/bin/
ssh deus@host 'pkill -f "codemux-remote pty-daemon"'
```
(This is exactly what bit us through the entire PR #15 debugging marathon — multiple "the bug isn't fixed" loops were really "the host is running an old binary.")
What's needed
A "Reinstall agent on host" button in Settings → Hosts that:
Where in the UI
`src/components/settings/hosts-section.tsx` — each host row already has buttons (Test connection, Edit, Delete or similar). Add "Reinstall agent" next to or under the existing actions.
Acceptance criteria
Out of scope
Estimate
~1 hour. Mostly UI plumbing; backend command already exists.