Skip to content

feat(web): add per-machine Update buttons alongside Update all (#1560) - #1563

Merged
scuttletoby merged 3 commits into
mainfrom
feat/update-per-machine
Dec 1, 2026
Merged

scuttletoby merged 3 commits into
mainfrom
feat/update-per-machine

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Fixes #1560. Stacks on seam announcement PR #1562 (merge the seam PR first so fork-seam-check recognizes the 5 announced lines).

Summary

  • Sidebar update dialog (ForkUpdateMachinesDialog.tsx): adds an individual Update (or Retry) button on every updatable machine row in the table while keeping Update all in the footer, live per-machine progress (Downloading…, Restarting…, Updating providers…, Updated), and Copy update command buttons for manual-update machines in the skipped section. Track switches (UpdateTrackSwitchDialog) pass a title and keep upstream's dialog unchanged.
  • Auto-balance update banner (ForkBannerMachineUpdate.tsx): adds an individual Update (or Retry) button for each connected remote-updatable machine inside the banner popover alongside Update all.
  • Existing per-machine UI: Settings → Connections (SavedEnvironmentRows.tsx, ConnectionsSettings.tsx) already had a small icon-only update action for servers behind APP_VERSION, and open PR Waiting on you: list each machine's T3 update that waits on the owner (#808 row 7, part 2) #1436 lists behind servers on Waiting on you; this PR puts per-machine Update buttons directly in the update dialog and update banner where the user already sees "Update all".

Safety

  • Clicking Update on one machine updates only that machine (and its own provider updates, if any) and never triggers or restarts another machine's server.
  • Clicking Update on the machine hosting the UI the user is currently using (This app on desktop, or the primary server in the web UI) shows an explicit warning and waits for confirmation before restarting (noting any other machines still waiting and any running threads on that machine).
  • Clicking Update all in the web UI when the primary UI-hosting server is among multiple targets updates all other remote machines first (waiting for completion/handoff) and restarts the UI-hosting primary server last. Desktop already updates remote servers before restarting This app last.
  • Double-clicks and duplicate runs are guarded per machine via in-flight tracking, pendingUpdateEnvironmentIds, and live serverUpdateState.

General vs project

General: T3 fork web UI add-on under apps/web/src/components/fork/perMachineUpdate/ with 5 pinned seam lines across 2 upstream files. No project-specific config, machine names, IPs, or paths.

Checks

  • vp test run on perMachineUpdate.logic.test.ts (6/6), ForkUpdateMachinesDialog.browser.test.tsx (4/4), and SidebarUpdatePill.browser.test.tsx (5/5): all passed.
  • vp fmt and vp lint --report-unused-disable-directives on all changed files: 0 warnings, 0 errors.
  • vp run @t3tools/web#typecheck: 0 errors.
  • fork-seam-check.cjs --config-ref feat/update-per-machine-seam and fork-seam-check.test.cjs (126/126): passed.

🤖 Generated with Claude Code

@scuttletoby
scuttletoby force-pushed the feat/update-per-machine branch from 8b5cab5 to 927e1ff Compare December 1, 2026 10:55
@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: code · reviewer: GPT-6.2 Sol (high) · read at: 927e1ff
blocker: none
major: Composer Update all can restart the web UI host before the remotes have finished or handed off. apps/web/src/components/chat/useAutoBalanceUpdateBanner.tsx:150 still uses the shared batch action, which starts every eligible target concurrently at apps/web/src/components/ServerUpdateAction.tsx:232. For a boot-service primary it also has no UI-host warning. The new warning only wraps the individual button, and the sidebar's mixed-target branch also has no explicit UI-host restart warning. Route fleet actions through the same host-last sequencing and warn about the UI interruption before starting a fleet run that includes it.
major: Sidebar progress disappears and an active remote update can be bypassed when starting a host restart. apps/web/src/components/sidebar/updateEverything.logic.ts:171 moves running servers to skipped; apps/web/src/components/fork/perMachineUpdate/ForkUpdateMachinesDialog.tsx:215 discards skipped-only rows and :281–285/:493–498 leave Update all enabled when a server-only row is already running. Start an individual remote update and then click Update all while the remote is still downloading. Desktop's delegated batch no longer includes that remote, so its countdown can restart This app before the download hands off. A web run with another ready remote similarly waits only for its new targets. With one server-only target in web, SidebarUpdatePill.tsx:413 can unmount the entire dialog at update start. Keep active/completed rows visible and wait for or block on existing remote runs before a fleet host restart.
major: Per-machine failures don't reliably lead to Retry. apps/web/src/components/fork/perMachineUpdate/ForkUpdateMachinesDialog.tsx:365–379 ignores provider outcomes when marking a row complete. A failed provider-only run can show Update again, or be marked complete if its candidate goes away. A server success can also be recorded after its provider fails. In the mixed web batch :465–470 closes the dialog even when the primary update fails, with no shared batch retry state. Keep the failed component of each row actionable and keep a failed batch visible for retry.
minor: Confirmation stores a previous render's runner and warning at ForkUpdateMachinesDialog.tsx:385–415 and :545–548. A provider check, desktop download state change, disconnect or new running thread between opening and confirming the warning is not reflected in that snapshot. Store the target key and re-read eligibility and warning inputs when confirming. The composer host warning also hard-codes both counts to zero at ForkBannerMachineUpdate.tsx:59–64, even with live turns or other pending machines.
minor: The composer host confirmation can be queued twice because ForkBannerMachineUpdate.tsx:56–68 guards only through the server call after confirmation. Hold a pending guard from the first click through confirmation and execution. Shared server in-flight tracking already prevents simultaneous duplicate server RPCs.
minor: The order unit test checks array partitioning, and the browser test uses immediately resolved updates. Strengthen the existing browser ordering case with a deferred remote handoff and a live eligibility transition (or extend the sidebar entry-point test), then keep the ordering invariant at one layer. This would catch both an early host call and the disappearing active row.

State check: Empty, disconnected, and manual-only rows do not start server RPCs. Connected manual rows reuse the existing copy-command action. A connected still-behind server with a failed live state can Retry; a normal server RPC or IPC failure resolves as an outcome, and the finally handlers release their local guards. Those handlers propagate unexpected rejections to several discarded promises, but I found no normal RPC rejection introduced by the IIFEs. Repeat and interrupted runs have the gaps above. All five seam lines match the manifest, and the titled track-switch dialog keeps its existing path. Static review and diff whitespace check only.

@scuttletoby

Copy link
Copy Markdown
Owner Author

Addressed round-1 review findings at head 0902a2e6e3933bf480d3058c9d53377d6b47d428:

  • Sidebar mixed-target UI-host warning & host-last sequencing (Major 1, sidebar half): ForkUpdateMachinesDialog.tsx now shows an explicit UI-host restart confirmation warning before starting a mixed web Update all, waits for remote handoffs (and any externally running remote server) before restarting the UI host, and tracks the batch in updateEverythingRun.
    • Seam note on Composer Update all (useAutoBalanceUpdateBanner.tsx:150 / ServerUpdateAction.tsx:232): <ForkUpdate.Action> only mounts inside <PopoverPopup>, and neither useAutoBalanceUpdateBanner.tsx:150 nor ServerUpdateAction.tsx has an announced seam line in main's .github/fork-seams.json. Routing ServerUpdatesAction through host-last sequencing and a UI-host warning requires announcing a 2-line seam PR on main first (e.g., in ServerUpdateAction.tsx so it covers both the composer banner and Settings → Connections) rather than adding unannounced upstream lines here.
  • Active/completed row retention, active-remote guard, and single-target web unmount (Major 2):
    • Added buildVisibleDialogRows + render-synced rememberedRows so running, failed, and completed rows stay visible in the table (and active servers are excluded from the collapsed skipped section) when useUpdateEverything moves running servers to skipped or drops finished rows.
    • Included live serverUpdateState.status === "running" and local runningServerKeys in anyIndividualRunning so Update all is disabled while any server-only row is updating (preventing desktop/web fleet host restarts from bypassing an active remote download).
    • Registered individual and web-batch remote runs in updateEverythingRun (setUpdateEverythingRun / settleUpdateRunMachine), keeping SidebarUpdatePill (isRunningEverything) mounted even on a single server-only web target and preserving progress/retry in SidebarUpdateCapsule.
  • Partial failures & Retry (Major 3):
    • Checked getProviderUpdateRunOutcome for every provider run and tracked failed provider candidates (failedProvidersByKey), server outcome failures (failedServerByKey), completed servers (completedServerKeys), and local download/install failures (localFailure).
    • Failed provider-only runs stay visible with Retry even if the live candidate disappears; mixed rows where providers fail and the server succeeds stay actionable as Retry and retry only the failed provider(s) without restarting the server.
    • Mixed web Update all keeps the dialog open on any failure (including primary failure) with per-row Retry and shared updateEverythingRun retry state.
  • Live confirmation & composer banner counts/guard (Minors 4–5):
    • Stored only the confirmation target intent ({ kind: "row", key } or { kind: "web-update-all" }) and resolved warning text, eligibility, and action from live render state (clearing stale confirmation if the target becomes ineligible).
    • Computed live otherPendingCount, otherRunningCount, and runningThreads in ForkBannerMachineUpdate.tsx, and added a pendingRef + isPending guard from first click through confirmation and execution.
  • Tests (Minor 6):
    • Removed the redundant array-partitioning unit test from perMachineUpdate.logic.test.ts and strengthened ForkUpdateMachinesDialog.browser.test.tsx with deferred remote handoff, live serverUpdateState/rows transitions, active-remote blocking, partial-failure Retry, live-updating confirmation alerts, and ForkBannerMachineUpdate double-click/live-count coverage.

Checks run:

  • vp test run: perMachineUpdate.logic.test.ts (5/5), ForkUpdateMachinesDialog.browser.test.tsx (5/5), SidebarUpdatePill.browser.test.tsx (5/5), reactCompilerCoverage.test.ts -t "perMachineUpdate" (3/3)
  • vp fmt, vp lint --report-unused-disable-directives (0 warnings, 0 errors), vp run @t3tools/web#typecheck (0 errors)
  • fork-schema-check.cjs, fork-upstream-files-check.cjs, fork-seam-check.cjs --config-ref origin/main, fork-test-names-check.cjs, and check-script tests (201/201)

@scuttletoby

Copy link
Copy Markdown
Owner Author

lens: code · reviewer: GPT-6.2 Sol (high) · read at: 0902a2e
blocker: none
major: The sidebar capsule can bypass both UI-host restart safeguards. A failed web host registered by ForkUpdateMachinesDialog.tsx:625–640 or :781–814 becomes eligible for capsule Retry. Close the dialog after both a remote and the UI host fail, then click the capsule Retry. SidebarUpdateCapsule.tsx:111–121 calls updateEverythingRun.tsx:137–148, which starts both RPCs immediately without confirmation or waiting for the remote handoff. On desktop, start an individual remote update with a local app update already downloaded and close the dialog. The newly registered run has no local version, so SidebarUpdatePill.tsx:451–465 exposes Restart to update even during the remote download. Apply the same confirmation and ordering rules to these capsule actions.
major: A provider-only individual success permanently occupies the sidebar update slot. ForkUpdateMachinesDialog.tsx:625–640 registers the run in the providers phase. Only a run with a server advances that phase at :676–678. The final settle marks the row done but updateEverything.logic.ts:564–569 clears only a servers-phase run. The resulting capsule says 1 of 1 updated with no action and replaces the normal update trigger, including for later updates. Advance or clear a completed provider-only run. With a provider-only failure whose candidate disappeared, the footer Retry is also misleading. It calls onConfirm at ForkUpdateMachinesDialog.tsx:871–884, whose upstream runner closes the dialog and rebuilds the run from current candidates, so it never submits the saved failed candidate. Retry through the same targets as the row buttons.
major: A normal environment-keyed This app row disappears during its download. The upstream plan stops emitting local app rows while downloading (SidebarUpdatePill.tsx:238–242, desktopUpdate.logic.ts:54–73, updateEverything.logic.ts:944–950). The retained row has a real environment ID, so perMachineUpdate.logic.ts:103–122 never checks local progress for it. It vanishes when there is no provider update, taking the per-machine Downloading indicator with it. Track local activity by the row's app kind, and key local failure and completion the same way.
major: The web fleet run misses remote updates started after confirmation. ForkUpdateMachinesDialog.tsx:779 rejects an already-running server, which makes the captured alreadyRunningRemoteIds at :816–823 empty. The batch can then wait on a provider-only machine at :828–834. If the user closes the dialog and starts one of the planned remote server updates from another entry point during that wait, the fleet's subsequent call on that remote returns skipped through ServerUpdateAction.tsx:142–146. The handoff helper treats that resolved promise as finished, so :852–858 can restart the host while the external remote is still downloading. Check live remote state at the host restart boundary and wait for an actual handoff when a planned update was already in flight.

round 1, fixed: Initial sidebar mixed-web confirmation warns about the UI-host restart and waits for a planned remote's handoff on the normal path. An already-running server blocks the initial footer action.
round 1, fixed: Individual remote registration keeps the single-target web pill mounted at update start. The open dialog retains the exercised active and completed remote rows.
round 1, fixed: In-dialog row Retry covers the exercised disappeared provider candidate and mixed provider failure after server success. A mixed web batch keeps the dialog open on primary failure.
round 1, fixed: Sidebar confirmation re-resolves the current intent and warning from live render state. Composer per-machine warning uses current counts when opened and guards the pending confirmation against repeat clicks. The ordering test now defers handoff and changes the live row state, replacing the duplicate order unit test.

Composer Update all still starts eligible servers concurrently in the existing shared action. The proposed seam and follow-up can track that existing gap separately. It does not independently block this scoped PR, but it remains part of #1560's full safety goal.

State check — Empty, manual-only, and disconnected server rows cannot start a server update through the new row action. Existing live remote runs block initial Update all. Repeat, partial-failure, and interrupted flows have the lifecycle and restart gaps above. The titled track-switch dialog still takes the existing path. Diff whitespace check passed. Capacity-gated checks against the pinned source reproduced the stuck provider-only capsule, the missing local download row, and concurrent capsule retry; full CI was not rerun. Extend the existing sidebar entry-point coverage through the real run atom and capsule to catch these gaps.

@scuttletoby

Copy link
Copy Markdown
Owner Author

Fix round 2 pushed at cdd4ae760a66d127974f48ec6047ef842d4adc4b addressing all round-2 review findings without adding any upstream seam lines:

  • Sidebar capsule UI-host restart safeguards:
    • Web UI-host failures clear machine.server in updateEverythingRun (settleForkUpdateRunMachine), so clicking capsule Retry only retries non-host remote servers and never restarts the UI host unconfirmed or concurrently with a remote; a solo failed UI host offers Dismiss so retrying goes through the dialog confirmation.
    • On desktop when a local app update is downloaded or downloading, fork-owned remote runs hold localVersion (resolveLocalGuardVersion) so SidebarUpdatePill does not expose an unconfirmed Restart to update button during remote downloads; settling all machines done or dismissing clears the run cleanly (syncForkUpdateRunState).
  • Provider-only run cleanup & footer Retry:
    • finishForkRunMachineProviders / settleForkUpdateRunMachine advance the run out of the providers phase once no unsettled machine is still updating providers, so a completed provider-only individual run closes to null instead of sticking on 1 of 1 updated.
    • Footer Retry / Retry all now runs through runForkReadyBatch using the same per-row targets (including saved failed provider candidates that disappeared from live state and skipping already-completed servers) instead of delegating to upstream onConfirm.
  • Environment-keyed This app row during local download, failure, and completion:
    • buildVisibleDialogRows tracks local activity (isUpdatingLocal, isDownloadingLocal, hasLocalFailure) by app === "this-app" in addition to envId === null, and preserves app: "this-app" when a local row still has provider updates during download.
    • runLocalAppUpdate now keys local provider failures and completion by the row's key (environment ID when environment-keyed) rather than hardcoding "this-app".
  • Live remote handoff check at the web host restart boundary:
    • When updateServer returns skipped because an external entry point already started that planned remote after confirmation, runSingleRemoteMachine checks live serverEnvironment.updateStateAtom and awaits the live run (waitForExistingServerCompletion) instead of treating skipped as finished.
    • runWebUpdateAllWithUiHostLast checks live non-host remote states (waitForAllLiveRemoteHandoffs) at the host restart boundary (both after ordered.first handoffs and immediately before updateServer on the UI host) until every in-flight remote has handed off or finished.

Tests extended through the real SidebarUpdatePill, SidebarUpdateCapsule, and updateEverythingRun atom (failing-first before fixes, passing after):

  • perMachineUpdate.logic.test.ts (7/7), ForkUpdateMachinesDialog.browser.test.tsx (7/7), reactCompilerCoverage.test.ts -t "perMachineUpdate" (3/3), vp fmt & vp lint (0 errors/warnings), @t3tools/web#typecheck (0 errors), and local fork-checks scripts (all passed).

@scuttletoby scuttletoby added the fork:merge-ready Merge conveyor: lenses done, merge when green (PRs) label Dec 1, 2026
@scuttletoby
scuttletoby merged commit 5e184e6 into main Dec 1, 2026
28 checks passed
@scuttletoby
scuttletoby deleted the feat/update-per-machine branch December 1, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork:merge-ready Merge conveyor: lenses done, merge when green (PRs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update: an Update button for each machine, not only all at once

1 participant