The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 13:15 UTC
fix(web): update everything no longer waits on npm for service hosts (#26917)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 29, 2026 at 04:28 UTC
e6ca17001d0f7d52d3ddde299936095561e9b6c8
6 files changed
+73
-20
.github/workflows/release.yml
+13
@@ -947,6 +947,7 @@ jobs:
947
body_path: ${{ hashFiles('release-notes.md') != '' && 'release-notes.md' || '' }}
948
previous_tag: ${{ needs.preflight.outputs.previous_tag }}
949
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
950
+ draft: ${{ needs.preflight.outputs.is_prerelease }}
951
make_latest: ${{ needs.preflight.outputs.make_latest }}
952
files: ${{ steps.release_files.outputs.files }}
953
fail_on_unmatched_files: true
@@ -962,11 +963,23 @@ jobs:
963
generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
964
body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
965
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
966
+ draft: ${{ needs.preflight.outputs.is_prerelease }}
967
make_latest: ${{ needs.preflight.outputs.make_latest }}
968
files: ${{ steps.release_files.outputs.files }}
969
fail_on_unmatched_files: true
970
token: ${{ github.token }}
971
972
+ # The action keeps a stable release a draft until its assets finish uploading, but publishes a
973
+ # prerelease first. Desktop clients update connected servers from the CLI archives as soon as
974
+ # they see the release, so a prerelease also goes public only once every asset is attached.
975
+ - name: Publish prerelease
976
+ if: needs.preflight.outputs.is_prerelease == 'true'
977
+ env:
978
+ GH_TOKEN: ${{ github.token }}
979
+ GH_REPO: ${{ github.repository }}
980
+ RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
981
+ run: gh release edit "$RELEASE_TAG" --draft=false
982
+
983
# The `t3` npm package is a launcher that downloads this version's CLI
984
# archive from the GitHub Release, so it publishes only once that release
985
# exists. Preview publishes too, under the `preview` dist-tag, which
apps/web/src/components/sidebar/updateEverything.logic.test.ts
+17
@@ -69,6 +69,7 @@ describe("collectServerUpdateTargets", () => {
69
machine("manual", "0.0.40", undefined),
70
],
71
"0.0.50",
72
+ true,
73
);
74
75
expect(targets.map((target) => [target.serverLabel, target.targetVersion])).toEqual([
@@ -84,6 +85,22 @@ describe("collectServerUpdateTargets", () => {
85
["manual", "needs a manual update"],
86
]);
87
});
88
+
89
+ it("waits for npm only for hosts that install from it or when the release may lack archives", () => {
90
+ const hosts = [
91
+ machine("archive-service", "0.1.4", "boot-service"),
92
+ machine("npm-service", "0.0.40", "boot-service"),
93
+ machine("legacy-respawn", "0.1.4", "respawn"),
94
+ machine("desktop", "0.1.4", "desktop-managed"),
95
+ ];
96
+ const waits = (releaseArchivesPublished: boolean) =>
97
+ collectServerUpdateTargets(hosts, "0.1.5", releaseArchivesPublished).waitForNpm.map(
98
+ (target) => target.serverLabel,
99
+ );
100
+
101
+ expect(waits(true)).toEqual(["npm-service", "legacy-respawn"]);
102
+ expect(waits(false)).toEqual(["archive-service", "npm-service", "legacy-respawn"]);
103
+ });
104
});
105
106
describe("collectChannelSwitchTargets", () => {
apps/web/src/components/sidebar/updateEverything.logic.ts
+25
-5
@@ -63,14 +63,25 @@ export interface SkippedMachine {
63
readonly reason: string;
64
}
65
66
+/** Boot services before this build installed the server from npm, not from release archives. */
67
+const RELEASE_ARCHIVE_SELF_UPDATE_SINCE = "0.0.41-nightly.20260914.1700";
68
+
69
/** Skip current and app-hosted servers; the latter update with the app and would relaunch mid-run.
67
- * Desktop-managed servers use their own feed. */
70
+ * Desktop-managed servers use their own feed. `waitForNpm` lists targets that need
71
+ * `t3@<targetVersion>` on npm first. `releaseArchivesPublished` means the version came from the
72
+ * desktop feed: its GitHub Release goes public with the CLI archives that boot services download. */
73
export function collectServerUpdateTargets(
74
machines: ReadonlyArray<UpdateEverythingMachine>,
75
targetVersion: string,
71
-): { readonly targets: ServerUpdateTarget[]; readonly skipped: SkippedMachine[] } {
76
+ releaseArchivesPublished: boolean,
77
+): {
78
+ readonly targets: ServerUpdateTarget[];
79
+ readonly skipped: SkippedMachine[];
80
+ readonly waitForNpm: ServerUpdateTarget[];
81
+} {
82
const targets: ServerUpdateTarget[] = [];
83
const skipped: SkippedMachine[] = [];
84
+ const waitForNpm: ServerUpdateTarget[] = [];
85
for (const machine of machines) {
86
const config = machine.serverConfig;
87
if (machine.hostedByThisApp) continue;
@@ -105,16 +116,25 @@ export function collectServerUpdateTargets(
116
skip(`on the ${cliReleaseChannelOf(serverVersion)} channel`);
117
continue;
118
}
108
- targets.push({
119
+ const target: ServerUpdateTarget = {
120
environmentId: machine.environmentId,
121
serverLabel: machine.label,
122
selfUpdate,
123
installation: config.environment.capabilities.serverInstallation,
124
desktopAppUpdate,
125
targetVersion,
115
- });
126
+ };
127
+ targets.push(target);
128
+ if (
129
+ selfUpdate !== "desktop-managed" &&
130
+ (!releaseArchivesPublished ||
131
+ selfUpdate === "respawn" ||
132
+ compareSemverVersions(serverVersion, RELEASE_ARCHIVE_SELF_UPDATE_SINCE) < 0)
133
+ ) {
134
+ waitForNpm.push(target);
135
+ }
136
}
117
- return { targets, skipped };
137
+ return { targets, skipped, waitForNpm };
138
}
139
140
function unavailableReason(machine: UpdateEverythingMachine): string | null {
apps/web/src/components/sidebar/useUpdateEverything.ts
+11
-12
@@ -68,19 +68,18 @@ export function useUpdateEverything(
68
canMaintain: canUpdateServer(sessionStates[index]!),
69
updateState: updateStates[index]!,
70
}));
71
- const { targets: behindServers, skipped: unreachable } = channelSwitch
72
- ? collectChannelSwitchTargets(machines, channelSwitch)
73
- : collectServerUpdateTargets(machines, targetVersion);
74
- // Desktop-managed servers use their app feed; only npm installs need to wait for publication.
71
// A track switch's target came from npm already.
76
- const needsNpm =
77
- channelSwitch === undefined &&
78
- behindServers.some((server) => server.selfUpdate !== "desktop-managed");
79
- const published = useNpmReleasePublished(needsNpm ? targetVersion : null);
80
- const servers =
81
- published || channelSwitch !== undefined
82
- ? behindServers
83
- : behindServers.filter((server) => server.selfUpdate === "desktop-managed");
72
+ const {
73
+ targets: behindServers,
74
+ skipped: unreachable,
75
+ waitForNpm,
76
+ } = channelSwitch
77
+ ? { ...collectChannelSwitchTargets(machines, channelSwitch), waitForNpm: [] }
78
+ : collectServerUpdateTargets(machines, targetVersion, localUpdateVersion !== null);
79
+ const published = useNpmReleasePublished(waitForNpm.length > 0 ? targetVersion : null);
80
+ const servers = published
81
+ ? behindServers
82
+ : behindServers.filter((server) => !waitForNpm.includes(server));
83
const skipped: ReadonlyArray<SkippedMachine> = [
84
...unreachable,
85
...behindServers
docs/operations/release.md
+4
-1
@@ -431,7 +431,10 @@ release archives, and then its npm launcher, available before users can receive
431
432
The workflow enforces this ordering:
433
434
-1. `release` publishes the GitHub Release with the CLI archives and `SHA256SUMS`.
434
+1. `release` publishes the GitHub Release with the CLI archives and `SHA256SUMS`. Every channel
435
+ uploads to a draft and publishes only after all assets are attached, so a version in the
436
+ desktop update feed always has its archives. **Update everything** relies on this to update
437
+ background-service hosts before npm has the version.
438
2. `publish_cli` publishes the `t3@<version>` launcher, which downloads from that release, on every
439
channel.
440
3. `deploy_web` depends on both before moving the hosted channel to the new client.
docs/user/updating.md
+3
-2
@@ -22,8 +22,9 @@ restart from the update button when you are ready. A server still restarting
22
finishes on its own, and the button keeps showing it after the desktop app
23
restarts.
24
25
-Server updates appear only after that version is published to npm. Remote
26
-desktop apps do not wait for npm. The confirmation lists each machine it skips
25
+Remote desktop apps never wait for npm. Background services do not wait either
26
+when the version comes from the desktop app's update. Other server updates
27
+appear only after that version is published to npm. The confirmation lists each machine it skips
28
and why, such as a machine that is offline or needs a manual update. Use
29
**Settings → Environments** for those.
30