Skip to content

Install stock clients from the day's saved downloads before the registry - #394

Merged
n0rpan merged 3 commits into
mainfrom
ci/outside-services-fallback
Dec 3, 2026
Merged

n0rpan merged 3 commits into
mainfrom
ci/outside-services-fallback

Conversation

@n0rpan

@n0rpan n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Part of the merge-queue speedup. Complements #386, which covers the Ubuntu Snapshot half of the same problem.

Why

On 2026-12-03 the queue ran 69 CI runs for 29 pull requests; 17 failed. Nine of those belong to pull requests that later merged, all nine without a new commit. Median time in the queue went from about 20 minutes to 113, because each failure rebuilds every candidate behind it.

Four of the 17 failed in a stock-client install when registry.npmjs.org timed out (12:34, 13:12, 13:28 and 14:24 UTC):

Run Job Error
47105948324 Host sessions (stock Claude floor) EIDLETIMEOUT after 5 min 44 s
47110969509 package (ubuntu-24.04-arm) EIDLETIMEOUT
47112772038 package (macos-26) EIDLETIMEOUT
47119008515 package (macos-26) ETIMEDOUT

npm had already retried inside each of these. Another retry would add minutes and still fail during an outage that lasts two hours.

What changes

  • desktop/ci/npm.sh runs every stock-client npm install and npm view in CI. With OX_NPM_OFFLINE_FIRST=1 it adds --prefer-offline; otherwise it is plain npm.
  • .github/actions/stock-client-downloads restores npm's download cache for the runner's OS and architecture and sets that variable when something was restored.
  • The desktop package job on main saves the cache once per UTC day. It installs every client version the fast lane installs, so one save serves both.

How old can latest be? A pull request or merge candidate restores today's downloads, or yesterday's if main has not saved today. Nothing older is restored; without either, the job asks the registry as before. main restores only today's, so its first run of each day resolves latest from the registry and a saved day never carries an earlier day's contents. The newest release a job can miss is under two days old. The nightly run in ci.yml does not use these scripts and still checks latest live.

  • stock-client-downloads in ci.yml runs on main after the desktop packages build and deletes these caches when their date is before yesterday, on any ref. It is the only job with actions: write, and it runs desktop/ci/stock_client_downloads.py and no build. It sits in ci.yml because a job in the called desktop.yml cannot hold more than the caller's read-only token. A failed listing or delete is a warning, since GitHub's seven-day expiry still applies.

The cache is written only from main, the same trust as the cargo and APT caches these jobs already restore.

Verified

  • python3 -m unittest discover -s desktop/ci -p 'test_*.py': 63 passed. shellcheck and actionlint report nothing new.

  • Locally, npm 10.9.9, registry unreachable: stock-clients.sh baseline fails with ECONNREFUSED on an empty cache and installs Codex 0.171.0 and Claude Code 2.1.331 from a warm one. npm.sh view @openai/codex@latest version answers from the warm cache.

  • On hosted runners, run 47146877013 on a throwaway branch: all of ubuntu-24.04, ubuntu-24.04-arm, macos-26 and macos-26-intel saved the cache, then a second job restored it through the action and installed the floor clients with the registry unreachable.

  • The cleanup against the real caches API, run 47157860566 on a throwaway branch: the listing returned {id, key, ref} for five caches, the script deleted a disposable cache dated 2026-11-01, kept the ones dated today, and printed no warning.

Not verified

  • The save step in desktop.yml runs only on main. Its first run is the first main build after merge; until it has run, every job behaves as today.
  • The restore of yesterday's key. The hosted check restored today's.
  • claude-protocol.sh and protocol.sh offline. They need the packaged build; this pull request's own package jobs run them through npm.sh against the registry.
  • The cleanup job's own first run on main. Its script is exercised, see above.
  • Cache budget. The floor clients alone are about 365 MB per platform before compression; with latest expect roughly twice that, on four platforms, per day. I could not read the repository's cache usage. With the cleanup, at most two days per platform remain.

Checked against main at f89bbf4. The throwaway branch tmp/stock-client-cleanup-check still exists: this session cannot delete branches.

https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz


Generated by Claude Code

registry.npmjs.org timed out on and off for about two hours on 2026-12-03.
Four merge candidates failed in a stock-client install (EIDLETIMEOUT,
ETIMEDOUT), none because of its own change, and each failure rebuilt the
candidates queued behind it.

The desktop package job on main now saves npm's download cache once per UTC
day and platform. Pull requests and merge candidates restore today's or
yesterday's and install with --prefer-offline, so the registry is asked only
for what the downloads lack. Nothing older than yesterday is restored:
`latest` is at most two days behind the registry, and main resolves it from
the registry on the first run of each day.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-03T18:05:05.267365Z 08c4484 Manual request
🔒 Security Review ✅ Completed 2026-12-03T19:10:32.067966Z 08c4484 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

The red Fast lane / Fast Linux workbench check on 79d32fd is not from this change. Job 144399472826 stopped in Install toolchain and runtime, in apt-get update, before any step this pull request touches:

E: Failed to fetch https://snapshot.ubuntu.com/ubuntu/20261203T161138Z/dists/noble/InRelease  502  Bad Gateway

That is the Ubuntu Snapshot outage #386 addresses, still happening at 16:12 UTC. I have not re-run the job: it would meet the same answer until Snapshot recovers or #386 lands. Both stock-client protocol jobs in the same run passed through desktop/ci/npm.sh.


Generated by Claude Code

No job restores a day's downloads after the following day, but GitHub keeps
an unread cache for seven more: about eight days of copies on four
platforms, counted against the budget the cargo and APT caches share.

A job on main deletes them after the desktop packages build. It holds the
only token that may delete caches and runs no build. A failed listing or
delete is a warning: GitHub's own expiry still applies.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a151effc74

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/ci/stock_client_downloads.py Resolved
A cleanup that deletes nothing and one whose listing came back empty looked
the same in the log.

The listing and deletion are now exercised against the real caches API:
run 47157860566 on a throwaway branch saved two disposable caches, and the
script deleted the one dated 2026-11-01 and kept today's.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 08c4484


Generated by Claude Code

@n0rpan

n0rpan commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

In line to merge. Commit 08c4484 is reviewed with nothing blocking; it has entered the merge queue.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 08c4484

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

Asked for by the maintainer’s queue request, for commit 08c4484.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 08c4484995

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@n0rpan n0rpan added the full-ci label Dec 3, 2026 — with Claude
@n0rpan n0rpan removed the full-ci label Dec 3, 2026

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

The earlier request was answered with a code review of 08c4484; the security row still names an older commit. Please run the security review on 08c4484.


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 08c4484995

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@n0rpan
n0rpan added this pull request to the merge queue Dec 3, 2026
n0rpan added a commit that referenced this pull request Dec 3, 2026
* Start the security review of a requested head from the merge gate

The gate asks for a security review of the head with a comment. Codex
answers that comment with a code review and leaves its security entry at
an older commit, so the gate waits for an answer that does not come. On
2026-12-03, #394, #388 and #401 each waited about an hour that way, with
consent given, checks green and no findings, until the maintainer merged
around the gate.

Codex starts its security review when a pull request opens or a draft is
marked ready. Every pull request the gate admitted that day carried the
trigger "Draft marked ready" on both reviews, and #388 received both for
its head within two minutes of being made a draft and ready again.

After recording the request in its comment, the gate now does that itself,
once per head commit. If it cannot mark the pull request ready again it
retries once and fails the run.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz

* Keep the queue request when the merge gate removes a held pull request

A pull request that is in the queue while the gate holds it is taken out
by the gate. The gate then read its own removal as the end of the
maintainer's request: #388 was queued by hand at 18:16 UTC on 2026-12-03
while its security review was missing, removed by the gate at 18:32, and
answered "previous queue request expired after removal" once the reviews
were in.

GitHub records the gate's removal and one made by hand identically (reason
"manual", the maintainer's account), and its own as "failed_checks" by
github-merge-queue. So the gate notes the time of a removal it made in its
status comment, and only that removal leaves the request standing. A
removal GitHub made first is not recorded.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz

---------

Co-authored-by: Claude <[email protected]>
@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

@codex security review

@n0rpan
n0rpan removed this pull request from the merge queue due to a manual request Dec 3, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 08c4484995

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@n0rpan

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

/queue 08c4484

@n0rpan
n0rpan added this pull request to the merge queue Dec 3, 2026

n0rpan commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator Author

The first queue candidate for this pull request failed, and I do not think this change caused it. Run 47171796465, job package (ubuntu-24.04), step Verify the workbench against floor and current stock Codex: with Codex 0.171.0 installed correctly (codex-cli 0.171.0), views::workbench::tests::stock_session ran past 60 seconds and the fixture raised

desktop/tests/stock_session.py, do_POST: assert params.get("service_tier") == expected["tier"]

four times. Evidence it is not the install path this pull request changes: the client was installed and reported its version before the test started, and the candidate queued directly behind this one, run 47171901605 for #388, contained this change and passed the same step two minutes later.

I have not found the cause. A test that fails and then passes on the same code has a bug; this one needs someone to read stock_session.py against the worker-inherit and service-tier paths. I am not re-running anything: GitHub has already rebuilt the candidate.


Generated by Claude Code

n0rpan pushed a commit that referenced this pull request Dec 3, 2026
Both inserted a line before the same entry, which the queue could not merge.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NazrMMqBKWzYjLU4xFBcbz
Merged via the queue into main with commit 545fc97 Dec 3, 2026
52 of 65 checks passed
@n0rpan
n0rpan deleted the ci/outside-services-fallback branch December 3, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants