Skip to content

Commit 6669872

Browse files
feat(ui): let admins dismiss the sidebar update indicator (#128365)
* feat(ui): let admins dismiss the sidebar update indicator Refs #128232 * refactor(ui): clean up update dismissal flow * fix(ui): align update action state * fix(ui): keep update reconciliation non-actionable * fix(ui): preserve update reconciliation visibility * fix: validate update dismissal facts * fix(ui): resurface active updates * fix(ui): show applying update campaigns * fix(gateway): preserve boot identity * perf(ui): split sidebar update styles * fix(test): provide captured plugin runtime
1 parent bb6e4b1 commit 6669872

40 files changed

Lines changed: 935 additions & 93 deletions

‎config/assertion-safety-baseline.txt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3548,7 +3548,7 @@ src/plugins/bundled-channel-config-metadata.ts 4
35483548
src/plugins/bundled-plugin-scan.ts 1
35493549
src/plugins/candidate-install-owner.ts 2
35503550
src/plugins/capability-provider-runtime.ts 16
3551-
src/plugins/captured-registration.ts 3
3551+
src/plugins/captured-registration.ts 2
35523552
src/plugins/channel-presence-policy.ts 2
35533553
src/plugins/channel-validation.ts 1
35543554
src/plugins/clawhub.ts 10
@@ -4063,7 +4063,6 @@ ui/src/components/session-menu.ts 1
40634063
ui/src/components/session-organizer-controller.ts 5
40644064
ui/src/components/settings-sidebar.ts 3
40654065
ui/src/components/settings-ui.ts 7
4066-
ui/src/components/sidebar-attention-dismissals.ts 1
40674066
ui/src/components/sidebar-attention.ts 4
40684067
ui/src/components/terminal/terminal-connection.ts 2
40694068
ui/src/components/terminal/terminal-controller-lifecycle.ts 1

‎packages/gateway-protocol/src/schema/frames.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export const HelloOkSchema = closedObject({
9090
server: closedObject({
9191
version: NonEmptyString,
9292
buildId: Type.Optional(Type.String({ minLength: 1, maxLength: 96 })),
93+
bootId: Type.Optional(Type.String({ minLength: 1, maxLength: 96 })),
9394
controlUiBuildSource: Type.Optional(
9495
Type.Union([Type.Literal("bundled"), Type.Literal("configured")]),
9596
),

‎scripts/control-ui-mock-dev.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const OBSERVER_DEMO_RUN_ID = "mock-session-observer-run";
9090
const PLAN_DEMO_RUN_ID = "mock-plan-run";
9191
const CUSTODIAN_CHAT_REPLY_DELAY_MS = 600;
9292
const CHAT_SEND_REPLY_DELAY_MS = 200;
93-
9493
type UpdateFixture = {
9594
available: UpdateAvailable;
9695
runResponse: unknown;
@@ -1947,6 +1946,7 @@ async function createChatPickerScenario(
19471946
assistantAgentId: "main",
19481947
assistantName: "Molty",
19491948
defaultAgentId: "main",
1949+
gatewayBootId: "mock-gateway-boot-1",
19501950
serverBuildId: "mock",
19511951
updateSchedule,
19521952
updateAvailable: updateFixture?.available ?? null,

‎src/cli/gateway-cli/run.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,7 @@ async function runGatewayCommandOnce(opts: GatewayRunOpts, hooks: GatewayRunRunt
11941194
startupConfigSnapshotReadForNextStart = undefined;
11951195
return await startGatewayServer(port, {
11961196
bind,
1197+
...(activeBootId ? { bootId: activeBootId } : {}),
11971198
auth: authOverride,
11981199
tailscale: tailscaleOverride,
11991200
startupStartedAt,

‎src/gateway/server-public.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export type GatewayServer = {
2222
};
2323

2424
export type GatewayServerOptions = {
25+
/** Exact lifecycle generation projected to connected clients. */
26+
bootId?: string;
2527
/**
2628
* Bind address policy for the Gateway WebSocket/HTTP server.
2729
* - loopback: 127.0.0.1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { describe, expect, it } from "vitest";
2+
import { startGatewayServerCore } from "./server-start.js";
3+
4+
describe("Gateway boot ID", () => {
5+
it.each(["", " ", " boot-a", "boot-a ", "x".repeat(97)])(
6+
"rejects an invalid public boot ID",
7+
async (bootId) => {
8+
await expect(startGatewayServerCore(0, { bootId })).rejects.toThrow(
9+
"Gateway boot ID must contain 1 to 96 characters",
10+
);
11+
},
12+
);
13+
});

‎src/gateway/server-start.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { randomUUID } from "node:crypto";
12
import { formatErrorMessage } from "../infra/errors.js";
23
import { createLazyRuntimeModule } from "../shared/lazy-runtime.js";
34
import {
@@ -24,6 +25,16 @@ export async function startGatewayServerCore(
2425
port = 18789,
2526
opts: GatewayServerOptions = {},
2627
): Promise<GatewayServer> {
28+
// Direct embedders have no CLI lifecycle row, so the server start boundary
29+
// still owns an exact generation instead of making clients infer one.
30+
const suppliedBootId = opts.bootId;
31+
if (
32+
suppliedBootId !== undefined &&
33+
(suppliedBootId.trim() !== suppliedBootId || !suppliedBootId || suppliedBootId.length > 96)
34+
) {
35+
throw new Error("Gateway boot ID must contain 1 to 96 characters");
36+
}
37+
const bootId = suppliedBootId ?? randomUUID();
2738
let releasePostReadyWork: () => void = () => {};
2839
const postReadyWorkBarrier = new Promise<void>((resolve) => {
2940
releasePostReadyWork = resolve;
@@ -68,6 +79,7 @@ export async function startGatewayServerCore(
6879
kernelRuntime: { ...gatewayKernel, ...transport },
6980
port,
7081
opts,
82+
bootId,
7183
log,
7284
logHealth,
7385
logWsControl,

‎src/gateway/server-startup-finish.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ type GatewayStartedRuntime = GatewayKernelRuntime & GatewayHttpTransport;
2626
export async function finishGatewayStartup(params: {
2727
kernelRuntime: GatewayStartedRuntime;
2828
port: number;
29+
bootId: string;
2930
opts: GatewayStartedRuntime["opts"];
3031
log: GatewayLogger;
3132
logHealth: GatewayLogger;
@@ -42,6 +43,7 @@ export async function finishGatewayStartup(params: {
4243
const {
4344
kernelRuntime: runtime,
4445
port,
46+
bootId,
4547
opts,
4648
log,
4749
logHealth,
@@ -148,6 +150,7 @@ export async function finishGatewayStartup(params: {
148150
attachGatewayWsHandlers({
149151
wss,
150152
clients,
153+
bootId,
151154
preauthConnectionBudget,
152155
port,
153156
gatewayHost: bindHost ?? undefined,

‎src/gateway/server-ws-runtime.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export function attachGatewayWsHandlers(params: GatewayWsRuntimeParams) {
2121
attachGatewayWsConnectionHandler({
2222
wss: params.wss,
2323
clients: params.clients,
24+
bootId: params.bootId,
2425
preauthConnectionBudget: params.preauthConnectionBudget,
2526
port: params.port,
2627
gatewayHost: params.gatewayHost,

‎src/gateway/server.preauth-hardening.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ describe("gateway pre-auth hardening", () => {
283283
attachGatewayWsConnectionHandler({
284284
wss,
285285
clients,
286+
bootId: "preauth-hardening-test-boot",
286287
preauthConnectionBudget,
287288
port: 0,
288289
getResolvedAuth: () => resolvedAuth,

0 commit comments

Comments
 (0)