fix(client-runtime): server updates stop waiting 32 minutes when the host returns without this update's outcome #27275
Mergedjuliusmarmingemerged 0 commits into
main fromrefs/pull/27275/headmerged by juliusmarminge View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
juliusmarminge added labelsbugfix
juliusmarminge added labelspr:gate-failed
- @@ -888,4 +928,10 @@888928 const streamExit = yield* environmentRegistry889929 .runStream(890930 target.environmentId,891- runStream(WS_METHODS.serverUpdateServerWithProgress, target.input),931+ Stream.unwrap(932+ bindAcceptedAt.pipe(933+ Effect.as(934+ runStream(WS_METHODS.serverUpdateServerWithProgress, target.input),935+ ),936+ ),937+ ),
- @@ -1317,0 +1423,21 @@1423+ connect: Effect.void,1424+ disconnect: Effect.void,1425+ retryNow: Effect.void,1426+ } satisfies EnvironmentSupervisor.EnvironmentSupervisor["Service"]);1427+ type Environments = EnvironmentRegistry.EnvironmentRegistry["Service"];1428+ const run: Environments["run"] = (_environmentId, effect) =>1429+ Effect.provideService(effect, EnvironmentSupervisor.EnvironmentSupervisor, supervisor);1430+ const runStream: Environments["runStream"] = (_environmentId, stream) =>1431+ Stream.provideService(stream, EnvironmentSupervisor.EnvironmentSupervisor, supervisor);1432+ const environments = EnvironmentRegistry.EnvironmentRegistry.of({1433+ run,1434+ runStream,1435+ followStream: runStream,1436+ stateChanges: () => Stream.never,1437+ retryNow: () => Effect.void,1438+ } as unknown as Environments);1439+ const cache = Persistence.EnvironmentCacheStore.of({1440+ loadShell: () => Effect.succeedNone,1441+ saveShell: () => Effect.void,1442+ loadThread: () => Effect.succeedNone,1443+ saveThread: () => Effect.void,@@ -1317,0 +1354,21 @@1354+ ({1355+ version: 1,1356+ sequence: 1,1357+ type: "ready",1358+ payload: { at, environment: { serverVersion }, ...(updateOutcome ? { updateOutcome } : {}) },1359+ }) as ServerLifecycleStreamEvent;1360+ const after = (delay: Duration.Input, event: ServerLifecycleStreamEvent) =>1361+ Stream.fromEffect(Effect.as(Effect.sleep(delay), event));1362+ const committed = (id: string, fromVersion: string, targetVersion: string) => ({1363+ id,1364+ fromVersion,1365+ targetVersion,1366+ status: "committed" as const,1367+ });1368+ const ACCEPTING = ready("2026-08-01T00:00:00.000Z", "0.0.30");1369+ const REPLACEMENT = ready("2026-08-01T00:05:00.000Z", "0.0.31");1370+1371+ // Lifecycle subscriptions opened before the update is acknowledged reach the accepting1372+ // process; later ones reach whatever the host has become.1373+ const launchUpdate = Effect.fn("ServerUpdateTest.launchUpdate")(function* (host: {1374+ readonly accepting: Stream.Stream<ServerLifecycleStreamEvent>;
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:M
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
juliusmarminge merged thisa74ee4c
juliusmarminge closed this
Sign in to join this conversation.


Approvability#
Verdict: Approved at
183bebcMacroscope's review found this PR approvable — Launcher updates now report failure promptly when a replacement host returns without the requested update outcome. The baseline and update request share a session, while authorization, committed-outcome validation, and the existing timeout fallback remain in place.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).