From 21071a38b8fc2b5cbeef653843dcc4a56871ff95 Mon Sep 17 00:00:00 2001 From: KiroCrewAutoBuilder <353126227+KiroCrewAutoBuilder@users.noreply.github.com> Date: Sat, 21 Nov 2026 06:30:08 +0000 Subject: [PATCH] fix(settings): keep the restart row while the update card has none Builder-Run: build-39354-7b990ef73db4 --- docs/feature-map/README.md | 2 +- .../settings/AboutPanelGatewayUpdate.tsx | 15 +++++--- .../AboutPanel.gatewayChannelRestart.test.tsx | 37 +++++++++++++++++++ 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/docs/feature-map/README.md b/docs/feature-map/README.md index ef24184e68d5..d8f57b296c89 100644 --- a/docs/feature-map/README.md +++ b/docs/feature-map/README.md @@ -465,7 +465,7 @@ is `/settings/`. Panels live in `pages/settings/`. | `developer` -> session control | One On/Off switch for `agent.session_control`, which withdraws the session-control tools from every agent at once (Bots and the owner-tab Conductor keep driving sessions they created while `agent.member_dispatch` is on). Drawn only once the stored value is read; a change applies on the next session-control call, running sessions included | `SessionControlSection.tsx` (mounted by `DeveloperPanel.tsx` after Agent MCP servers) | `handlers/core.py` (the shared config route) | `GET,PATCH /api/config/kirocrew` | | `advanced` (hidden: no tab, no search entry; `/settings/advanced` opens the first tab) | All settings: every scalar and string-list config key from the gateway's schema, with its help, current value, default and a Needs restart badge. A key with its own control links there; sandbox, approval, sign-in, reach, channel and preview keys are read-only; the rest get a toggle, select, number, text or one-per-line list, a save status line (Saves when you leave the field, Saving…, Saved) and Reset to default (removes the stored value). Rule per key: `config.md` § "Settings → Advanced" | `AdvancedPanel.tsx` (rows: `components/allSettings/AllSettingsList.tsx`) | `handlers/agents.py` (schema), `handlers/core_config_patch.py`, `handlers/config_all_settings.py` | `GET /api/config/schema`, `GET,PATCH /api/config/kirocrew` | | `about` → **Release notes** | At the foot of About: the running release's notes, then earlier releases five rows at a time, each opening in place; `/settings/releases` and `/settings/releases/` open About at that release. Under Updates, **What you'd get** lists the changes an available update brings, read from the changelog text the update carries | `ReleasesPanel.tsx`, `AboutPanelUpdateChanges.tsx`, `updateChanges.ts` | `handlers/updates.py` | `GET /api/releases` | -| `about` | Version, build, diagnostics bundle, and the in-app update step-up: an agent (or the panel) ARMS an update, a human approves it. On a managed-venv install the approval is the printed host command; on a packaged desktop install the gateway holds only a nonce-free request (version, who, when) and the approval is the human's own Install click in this panel, which drives the desktop updater's existing download→install IPC — there is no gateway endpoint that installs. **Restart gateway** is `POST /api/restart` in a browser; in the desktop app it is the app's own stop-respawn-reconnect of the gateway it runs (`gateway:restart` IPC), shown only for that gateway. An **Upcoming update** block sits inline under the update controls (never a pop-up) and shows only a version announced ahead of its release (a build already on offer is the update card's to show). On a container install, which updates only by pulling a newer image, the panel names a newer release and links its notes once the gateway has confirmed that version's image on GHCR (anonymous pull token, then a manifest HEAD; only a 200 counts), with no Update button. Release channel, update check, and the changelog behind the update prompt. A terminal CLI update on a POSIX git checkout also pokes the gateway (`POST /api/update/revalidate`, sent by the CLI, not the panel) to drop its cached update verdict and re-check, so the badge reconciles without waiting for the scheduled poll; the poke sends the local secret only after proving the connected peer is this install's gateway (owner-only unix socket, or loopback TCP on Windows and TCP-only gateways), and a peer that cannot be proven gets nothing and the badge reconciles on the next scheduled check or restart | `AboutPanel.tsx`, `AboutPanelUpdateFlow.tsx` (`InAppUpdateFlow`, `AgentUpdateRequestCard`, `RestartGatewayButton`), `AboutPanelGatewayUpdate.tsx`, `AboutPanelUpcomingUpdate.tsx`, `DesktopGatewayRestartRow.tsx`, `ReportProblemCard.tsx`, `shell/updates/updateFlow.tsx` | `handlers/diagnostics.py`, `handlers/feedback.py`, `handlers/updates.py`, `handlers/_update_feed.py` (internal release-feed transport), `http_proxy.py` (shared explicit proxy selection), `handlers/_update_announce.py`, `handlers/_update_image.py` (the container image probe), `platform/update_stepup.py`, `platform/app_update_request.py`, `cli_server_update.py` (the CLI poke) | `POST /api/diagnostics/collect`, `GET /api/diagnostics/download/{filename}`, `GET /api/update/check`, `POST /api/update`, `POST /api/update/channel`, `POST /api/update/revalidate`, `GET /api/changelog`, `POST,GET,DELETE /api/update/arm`, `POST /api/update/approve`, `POST /api/restart` | +| `about` | Version, build, diagnostics bundle, and the in-app update step-up: an agent (or the panel) ARMS an update, a human approves it. On a managed-venv install the approval is the printed host command; on a packaged desktop install the gateway holds only a nonce-free request (version, who, when) and the approval is the human's own Install click in this panel, which drives the desktop updater's existing download→install IPC — there is no gateway endpoint that installs. **Restart gateway** is `POST /api/restart` in a browser; in the desktop app it is the app's own stop-respawn-reconnect of the gateway it runs (`gateway:restart` IPC), shown only for that gateway. In a browser the standing Restart row stays on screen through the whole update lifecycle, hidden only while the installer card shows its command, since that card carries its own Restart. An **Upcoming update** block sits inline under the update controls (never a pop-up) and shows only a version announced ahead of its release (a build already on offer is the update card's to show). On a container install, which updates only by pulling a newer image, the panel names a newer release and links its notes once the gateway has confirmed that version's image on GHCR (anonymous pull token, then a manifest HEAD; only a 200 counts), with no Update button. Release channel, update check, and the changelog behind the update prompt. A terminal CLI update on a POSIX git checkout also pokes the gateway (`POST /api/update/revalidate`, sent by the CLI, not the panel) to drop its cached update verdict and re-check, so the badge reconciles without waiting for the scheduled poll; the poke sends the local secret only after proving the connected peer is this install's gateway (owner-only unix socket, or loopback TCP on Windows and TCP-only gateways), and a peer that cannot be proven gets nothing and the badge reconciles on the next scheduled check or restart | `AboutPanel.tsx`, `AboutPanelUpdateFlow.tsx` (`InAppUpdateFlow`, `AgentUpdateRequestCard`, `RestartGatewayButton`), `AboutPanelGatewayUpdate.tsx`, `AboutPanelUpcomingUpdate.tsx`, `DesktopGatewayRestartRow.tsx`, `ReportProblemCard.tsx`, `shell/updates/updateFlow.tsx` | `handlers/diagnostics.py`, `handlers/feedback.py`, `handlers/updates.py`, `handlers/_update_feed.py` (internal release-feed transport), `http_proxy.py` (shared explicit proxy selection), `handlers/_update_announce.py`, `handlers/_update_image.py` (the container image probe), `platform/update_stepup.py`, `platform/app_update_request.py`, `cli_server_update.py` (the CLI poke) | `POST /api/diagnostics/collect`, `GET /api/diagnostics/download/{filename}`, `GET /api/update/check`, `POST /api/update`, `POST /api/update/channel`, `POST /api/update/revalidate`, `GET /api/changelog`, `POST,GET,DELETE /api/update/arm`, `POST /api/update/approve`, `POST /api/restart` | | — (cross-cutting) | Host-side backup of the browser-held settings the tabs above write, so they survive a moved dashboard port or a relocated Electron `userData`. Restores on a profile that has never reached the host; allowlist-scoped (`DURABLE_PREF_KEYS`), not every browser key | — (no panel; `lib/uiPrefs.ts` is the client) | `handlers/ui_prefs.py` | `GET,PUT /api/ui-prefs` | Instances is deliberately not a rail row: it is set up here once and switched diff --git a/website/src/pages/settings/AboutPanelGatewayUpdate.tsx b/website/src/pages/settings/AboutPanelGatewayUpdate.tsx index f5b6893ddedf..b729c20dc540 100644 --- a/website/src/pages/settings/AboutPanelGatewayUpdate.tsx +++ b/website/src/pages/settings/AboutPanelGatewayUpdate.tsx @@ -411,6 +411,9 @@ export function AboutPanelGatewayUpdates({ // boot-time apply left, from the status frame. const armedVersion = useAppSelector(s => s.dashboard.status?.update_armed_version) || '' const pendingApplyError = useAppSelector(s => s.dashboard.status?.pending_apply_error) || '' + // Only the installer card with a command draws its own Restart; the in-app + // flow, the policy note and a command-less card draw none. + const cardHasRestart = showManualUpdate && !effectiveGwCanArm && !gwManagedByCommand && !!effectiveCommand return (
{armedVersion && ( @@ -644,11 +647,11 @@ export function AboutPanelGatewayUpdates({ when needed and one that only appears when an update happens to be offered. - Hidden while the manual-update card is on screen: that card - already renders a Restart button wired to the same mutation, and - two identical buttons a few rows apart read as two different - actions. */} - {restartControls && !showManualUpdate && ( + Hidden only while the update card renders its own Restart button + wired to the same mutation: two identical buttons a few rows apart + read as two different actions. Every other update card draws no + Restart, and restarting is the next step there. */} + {restartControls && !cardHasRestart && (
{/* One label, not a title + note pair: the button already names the @@ -675,7 +678,7 @@ export function AboutPanelGatewayUpdates({ user no feedback whatsoever. */} {/* askAgent on: a refused restart of a standing action; nothing on this card is a draft. */} - {restartControls && !showManualUpdate && ( + {restartControls && !cardHasRestart && ( )}
diff --git a/website/src/test/AboutPanel.gatewayChannelRestart.test.tsx b/website/src/test/AboutPanel.gatewayChannelRestart.test.tsx index 41d2226a2975..43646141ec39 100644 --- a/website/src/test/AboutPanel.gatewayChannelRestart.test.tsx +++ b/website/src/test/AboutPanel.gatewayChannelRestart.test.tsx @@ -563,6 +563,43 @@ describe('AboutPanel gateway restart', () => { expect(screen.queryByTestId('gateway-restart-row')).toBeNull() }) + it('keeps the standing Restart beside the in-app update flow, which draws none', async () => { + // An arm-capable install installs the new version beside the running one and + // starts it on the next restart, so restarting is the step left to take. + const posts = stubFetch() + seedStatus({ + update_available: true, + update_check_status: 'succeeded', + update_can_apply: false, + update_can_arm: true, + update_channel: 'nightly', + update_latest_version: '0.14.0.dev2', + }) + mountWeb() + + await screen.findByTestId('in-app-update') + expect(screen.queryByTestId('gateway-restart')).toBeNull() + fireEvent.click(screen.getByTestId('gateway-restart-standing')) + fireEvent.click(screen.getByTestId('gateway-restart-standing')) + await waitFor(() => expect(posts.some(p => p.url.includes('/api/restart'))).toBe(true)) + }) + + it('keeps the standing Restart when the installer card has no command', async () => { + stubFetch() + seedStatus({ + update_available: true, + update_check_status: 'succeeded', + update_can_apply: false, + update_command: '', + update_channel: 'stable', + }) + mountWeb() + + await screen.findByTestId('manual-update-instructions') + expect(screen.queryByTestId('gateway-restart')).toBeNull() + expect(screen.getByTestId('gateway-restart-row')).toBeTruthy() + }) + it('treats the connection drop after a restart as success, not failure', async () => { // os.execv replaces the process image, so the POST's connection is reset by // the very thing it asked for. Reporting that as an error would tell the