Add in-app Pi updates - #20
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe server now supports authenticated Pi self-updates with concurrency and active-turn protection. The API client sends long-running update requests to a selected Mac. Settings provides progress, retry, error, and version-refresh states. Installation tolerates an unloaded LaunchAgent. ChangesPi self-update
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant SettingsView
participant APIClient
participant PiUpdateRoute
participant PiUpdater
participant PiExecutable
SettingsView->>APIClient: updatePi(on: mac)
APIClient->>PiUpdateRoute: POST /pi-update
PiUpdateRoute->>PiUpdater: invoke update
PiUpdater->>PiExecutable: run self-update
PiUpdater->>PiExecutable: verify version
PiUpdateRoute-->>APIClient: PiVersionInfo
APIClient-->>SettingsView: updated version
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
What changed
POST /pi-updatecompanion endpoint that runspi update --self --no-approveon the selected Mac.Why
The app detected an available Pi release but only exposed a command for users to copy into Terminal. The companion server had no mutation endpoint, so the phone could not perform the maintenance action it was recommending.
Pi processes are launched per turn, so the next turn automatically uses the new executable. The Bun companion remains valid during a Pi-only update and does not need to restart. Active turns are rejected before updating so no running Pi process is disrupted.
The installer fix addresses
set -euo pipefailtreating a missing LaunchAgent as a fatal fresh-install error.Validation
xcodebuildDebug build for iPhone 17 simulatorbun build server/server.ts --target=bun --external qrcode-terminalbash -n server/install.shSummary by CodeRabbit
New Features
Bug Fixes