feat(installer): reload the agent after updates instead of prompting for sudo - #1215
JamieRuderman wants to merge 6 commits into
Conversation
…ll completion, latch refused reloads
…on, skip stopped agents, guard reload re-entry
|
@codex review |
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 964674b4c3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Why
Every desktop update re-ran the full sudo
agent uninstall+agent installbecause the running agent's version no longer matched the bundled CLI. Nothing in that sequence needs root after the first install: the service definition and the/usr/local/binsymlinks point at fixed paths that the update overwrites in place.What
binaryInstaller.check()now asks the running agent to adopt the installed binaries via the new unprivilegedremoteit agent reload(remoteit/cli-source#432) before falling back to the existing sudo install.reload()is guarded against re-entry, the completion sequence is shared withinstall(), andupdateVersions()reuses the version already read during the status check. The dead sudorestart()path is removed.Command.ts; signature and staging failures (411, 412) still report.Verified
binaryInstallerandCommandspecs (34 tests),tsc, prettier.Pairs with
remoteit/cli-source#432, which adds the
agent reloadcommand this calls. The two are independent: against an agent that predates the command this gets an unknown-message error, latches the refusal, and falls back to the sudo install, so either can ship first.The macOS privilege-escalation work is deliberately not part of this pairing. It is in remoteit/cli-source#430 and is being reviewed separately, at Nicolae's request, so the sudo-free update is not held up behind it.
Scope note
Reload is attempted wherever the agent is running and the bundled CLI is usable, and the agent itself decides whether it can adopt the binaries, so the sudo fallback stays correct on every platform. Codes 411 and 412 in the permanent-refusal list only occur once the staging work in remoteit/cli-source#430 lands; they are harmless until then.
Rollout
Ships independently. Once the paired CLI is bundled, Macs see one final password prompt on that update, then none.