Skip to content

improve(ci): cut warm startup metadata build time#109863

Merged
steipete merged 1 commit into
mainfrom
codex/node-compile-startup-cache
Jul 17, 2026
Merged

improve(ci): cut warm startup metadata build time#109863
steipete merged 1 commit into
mainfrom
codex/node-compile-startup-cache

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Warm CI builds restore declaration outputs but not dist/cli-startup-metadata.json, so every fresh job still launches the CLI help renderers. That costs roughly 6 seconds of an otherwise 16–22 second warm build.

Why This Change Was Made

The existing build-all artifact now carries a 44 KB startup-metadata seed. Each cache hit restores the seed, runs the existing exact signature validator, and refreshes the cached output if validation regenerates anything. Partial changes reuse unaffected command-help snapshots; commit/version changes rerender root help only.

The normal build job already persists Node's compile cache. A controlled cold/warm comparison showed no measurable additional build gain, so this PR does not add another Node cache path or change shard/workflow layout.

User Impact

No product behavior changes. CI producers spend less time regenerating identical CLI startup metadata, including after partial source changes.

Evidence

  • Blacksmith Testbox A/B: startup metadata 6.13s cold, 116ms after deleting the dist copy and restoring only .artifacts/build-all-cache; warm CI-artifact build 16.5s; seed 44 KB.
  • Node compile-cache A/B on identical warm full builds: 13.62s disabled, 13.46s cold cache, 13.42s warm cache (noise-level difference); cache 8.2 MB.
  • node scripts/run-vitest.mjs test/scripts/build-all.test.ts test/scripts/write-cli-startup-metadata.test.ts: 63 tests passed.
  • pnpm check:changed -- scripts/build-all.d.mts scripts/build-all.mjs scripts/write-cli-startup-metadata.ts test/scripts/build-all.test.ts test/scripts/write-cli-startup-metadata.test.ts: green on Blacksmith Testbox.
  • Autoreview: clean, no accepted/actionable findings.

AI-assisted: implementation and validation performed with Codex; maintainer understands the change.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Jul 17, 2026
@steipete steipete self-assigned this Jul 17, 2026

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

Copy link
Copy Markdown
Contributor

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: f13c705f6d

ℹ️ 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 on lines +780 to +784
reusableExisting &&
reusableExisting.browserHelpSourceSignature === browserHelpSourceSignature &&
typeof reusableExisting.browserHelpText === "string" &&
reusableExisting.browserHelpText.length > 0
? reusableExisting.browserHelpText

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Badge Refresh command help when build identity changes

On warm builds that restore a previous cli-startup-metadata.json, this reuses browserHelpText (and the analogous command snapshots below) when only the command source signature matches. However command help includes the global banner from src/cli/program/help.ts:130-136, and that banner embeds the current version/commit via formatCliBannerLine (src/cli/banner.ts:50-65). So a build where only dist/build-info.json changes refreshes root help but ships stale precomputed openclaw browser|secrets|nodes|doctor... --help banners from the cached seed.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 5024c10 into main Jul 17, 2026
122 of 124 checks passed
@steipete
steipete deleted the codex/node-compile-startup-cache branch July 17, 2026 09:25
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant