The best way to control Claude Code, Codex and more from any computer or phone
fix(release): update feed check waits for a just-published nightly (#39192)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Nov 19, 2026 at 12:54 UTC
cae24a6f0ef6c65be44a457940494e0d4f0c3b97
3 files changed
+42
-13
.github/scripts/check-nightly-release.cjs
+24
-10
@@ -124,7 +124,12 @@ async function resolveLatestNightlyCommit({ github, context, core }) {
124
// The two places a nightly install looks for an update: the `update-feed` pointer, and
125
// releases.atom, which holds the 10 newest git tags of any kind. Older installs take the first
126
// nightly in the feed. Reports what each names beside the newest published nightly.
127
-async function readNightlyUpdateFeed({ github, context, fetch = globalThis.fetch }) {
127
+async function readNightlyUpdateFeed({
128
+ github,
129
+ context,
130
+ fetch = globalThis.fetch,
131
+ sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
132
+}) {
133
const latest = await findLatestNightly({ github, context });
134
if (!latest) return {};
135
@@ -150,19 +155,28 @@ async function readNightlyUpdateFeed({ github, context, fetch = globalThis.fetch
155
156
// An unreadable feed leaves `feedTags` unset, so the pointer is still repaired. An error page
157
// can answer HTTP 200, so only an Atom document counts as read.
153
- let feedTags;
154
- try {
155
- const feed = await fetch(`${base}/releases.atom`, { signal: signal() });
156
- const body = feed.ok ? await feed.text() : "";
157
- if (/<feed[\s>]/.test(body)) {
158
- feedTags = Array.from(body.matchAll(/href="[^"]*\/releases\/tag\/([^"]+)"/g), (match) =>
158
+ const readFeed = async () => {
159
+ try {
160
+ const feed = await fetch(`${base}/releases.atom`, { signal: signal() });
161
+ const body = feed.ok ? await feed.text() : "";
162
+ if (!/<feed[\s>]/.test(body)) return {};
163
+ const feedTags = Array.from(body.matchAll(/href="[^"]*\/releases\/tag\/([^"]+)"/g), (match) =>
164
decodeURIComponent(match[1]),
165
);
166
+ const feedNightly = feedTags.find((tag) => /^v?\d+\.\d+\.\d+-nightly\./.test(tag));
167
+ return { feedTags, feedNightly };
168
+ } catch {
169
+ return {};
170
}
162
- } catch {}
163
- const feedNightly = feedTags?.find((tag) => /^v?\d+\.\d+\.\d+-nightly\./.test(tag));
171
+ };
172
+ // The feed can lag a release published seconds ago, so read it again before calling it hidden.
173
+ let feed = await readFeed();
174
+ for (let retry = 0; retry < 3 && feed.feedTags && feed.feedNightly !== latest.tagName; retry++) {
175
+ await sleep(30_000);
176
+ feed = await readFeed();
177
+ }
178
165
- return { tag: latest.tagName, pointerTag, feedNightly, feedTags };
179
+ return { tag: latest.tagName, pointerTag, ...feed };
180
}
181
182
module.exports = {
.github/scripts/check-nightly-release.test.cjs
+15
-1
@@ -247,19 +247,33 @@ const atomFeed = (tags) => new Response(`<feed>${tags.map(atomEntry).join("")}</
247
const NEWEST = "v1.0.1-nightly.20260905.123";
248
const OLDER = "v1.0.1-nightly.20260905.100";
249
250
+// `feed` is one response for every read, or a list read in order whose last entry repeats.
251
function updateFeedFixture({ feed, pointer }) {
252
const { options } = fixture({
253
releases: [nightly(1), nightly(0, { tagName: "v1.0.2-preview.1" })],
254
});
255
+ const feeds = [feed].flat();
256
options.fetch = async (url) =>
257
url === "https://github.com/example/app/releases.atom"
256
- ? feed
258
+ ? (feeds.length > 1 ? feeds.shift() : feeds[0]).clone()
259
: url === "https://github.com/example/app/releases/download/update-feed/nightly.json"
260
? pointer
261
: assert.fail(`unexpected fetch ${url}`);
262
+ options.sleeps = [];
263
+ options.sleep = async (ms) => void options.sleeps.push(ms);
264
return options;
265
}
266
267
+test("update feed check waits for a nightly published moments ago to reach the feed", async () => {
268
+ const options = updateFeedFixture({
269
+ feed: [atomFeed([OLDER]), atomFeed([NEWEST, OLDER])],
270
+ pointer: Response.json({ tag_name: NEWEST }),
271
+ });
272
+ const { feedNightly } = await readNightlyUpdateFeed(options);
273
+ assert.equal(feedNightly, NEWEST);
274
+ assert.deepEqual(options.sleeps, [30_000]);
275
+});
276
+
277
const missing = () => new Response("Not Found", { status: 404 });
278
// HTTP 200, then the connection drops before the body arrives.
279
const brokenBody = () =>
docs/operations/release.md
+3
-2
@@ -484,8 +484,9 @@ A nightly install finds the newest nightly in up to three places.
484
The release workflow's `Check the update feed` job runs on every scheduled tick, unless
485
`PAUSE_NIGHTLY` is set, and after every nightly. It waits in the same queue as nightlies and
486
previews. It rewrites a missing or outdated pointer. Its last step fails when the first nightly
487
-in the feed is not the newest one. A feed it could not read is only a warning: that says nothing
488
-about the tags, and the next tick reads it again.
487
+in the feed is not the newest one. The feed can lag a release published seconds earlier, so the
488
+job first reads it up to three more times, 30 seconds apart. A feed it could not read is only a
489
+warning: that says nothing about the tags, and the next tick reads it again.
490
491
When that step fails, installs that read only the feed cannot reach the newest nightly. If the
492
feed still names an older nightly first, installs from `4603` up to the first build with the