Skip to content

perf: speed up fresh cloud worker activation - #147945

Merged
steipete merged 1 commit into
mainfrom
codex/cloud-startup-next-speed
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/cloud-startup-next-speed

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fresh cloud workers enter unnecessary legacy-state migration work while enabling their required plugins.

User Impact

Cloud worker activation is faster. In three alternating local runs through the generated bootstrap and real built plugin CLI, median plugin activation fell from 3.98 seconds to 2.17 seconds (45%). This measures activation; provider provisioning, installation, and VNC connection time are separate.

Why This Change Was Made

Bootstrap published its runtime symlink before enabling plugins. That extra entry made a new state directory fail Doctor's existing pristine-state check. Publish the symlink after plugin activation, while retaining occupied-path validation before activation and publication before node launch.

Existing state still follows the same migration rules. Failed activation leaves the runtime pointer unpublished, and a retry can reuse the verified installation. No config, schema, dependency, or migration-policy changes are required.

Evidence

  • The new failed-activation regression fails on the original implementation because the runtime pointer already exists.
  • All 160 focused tests pass across enrollment, Linux/macOS replay, Windows bootstrap, cancellation, warm images, and pristine-state detection.
  • Paired generated-bootstrap checks pass for occupied pointers, failed activation, prior pointers followed by failure, and existing state. The timing harness uses real plugin activation with synthetic cached-install/version and final-node fixtures.
  • Independent review found no actionable P0–P2 findings.

The full candidate build passed. A fresh AWS Linux Tiny session created through the Control UI used the computer screenshot tool, returned READY, and displayed its XFCE desktop through VNC without a retry. Canonical reclaim and destroy confirmed cleanup, and the isolated Gateway, tunnel, and credential window were stopped. The Desktop panel was opened after the turn; first-pixel latency was not measured.

The cloud patch remains identical after rebasing onto main 8e6fe8e02ddb, and all 160 focused tests pass again at 84493dae713c. Two inherited test-file lint failures were repaired without changing limits or assertions; equivalent cleanups landed independently in #147869 and are now inherited from main, so this PR contains only the cloud bootstrap change and its regressions. Earlier UI performance comparison passed the unchanged startup-size budget. The full build, timings, and live cloud proof above precede this patch-identical rebase; exact-head CI passed.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 05:33
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 4:08 AM ET / 08:08 UTC (Revision 6).

ClawSweeper review

What this changes

Delays publishing a cloud worker’s runtime link until required plugins finish activating, avoiding unnecessary migration work on fresh workers and adding failure-path coverage.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, focused optimization absent from fetched main and the latest release. No actionable correctness or security defect was found; the maintainer-authored, protected PR is not a cleanup candidate.

Priority: P2
Reviewed head: 84493dae713c15aeb7c1e2b4b70f0f0163e3969e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow, maintainable ordering repair with meaningful failure coverage and relevant reported runtime validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor proof gate does not apply. The captured body additionally reports real plugin-CLI timing and successful AWS worker activation; those observations precede the rebase and were not rerun here.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor proof gate does not apply. The captured body additionally reports real plugin-CLI timing and successful AWS worker activation; those observations precede the rebase and were not rerun here.
Evidence reviewed 8 items Verified introduced production change: The pinned base-to-head diff moves only runtime-link publication past successful plugin activation. Occupied-path validation remains before activation, and publication remains before node launch.
Doctor explains the performance mechanism: The pristine-state predicate accepts only the config entry; any runtime link makes it select the full migration path. Existing state and migration-bearing configuration still reject the shortcut. The patch changes the producer’s ordering without weakening Doctor’s predicate.
Current main still publishes early: Fetched main still creates the runtime symlink before the plugin activation loop, so the central optimization remains outstanding.
Findings None None.
Security None None.

How this fits together

The Crabbox plugin prepares remote cloud workers from a verified OpenClaw package, enables their required plugins, and launches a node connected to the Gateway. Doctor checks the worker’s state directory during plugin activation to determine whether legacy migrations are needed.

flowchart TD
  A[Cloud worker request] --> B[Verify and prepare runtime]
  B --> C[Validate runtime link location]
  C --> D[Activate required plugins]
  D --> E{Activation succeeds?}
  E -->|Yes| F[Publish runtime link]
  F --> G[Launch connected node]
  E -->|No| H[Stop without publishing link]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +1, Tests +46. Total +47 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 2 1 +1
Tests 1 46 0 +46
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 48 1 +47

Review metrics

Metric Value Why it matters
Reported plugin activation improvement Median 3.98 s → 2.17 s across 3 alternating runs The reported measurement isolates plugin activation and does not claim faster provisioning or VNC first-pixel latency.

Technical review

Best possible solution:

Keep runtime publication in the bootstrap owner after successful activation, preserving Doctor’s existing migration rules and node-launch prerequisites.

Do we have a high-confidence way to reproduce the issue?

Yes, from source: fresh enrollment publishes a runtime link that fails Doctor’s config-only state predicate before plugin activation. No runtime reproduction or tests were executed during this read-only review.

Is this the best way to solve the issue?

Yes. Reordering publication fixes the unnecessary migration trigger at its producer without adding a bypass, duplicate migration policy, or new configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 069710f909f0.

Labels

Label justifications:

  • P2: This is a bounded cloud-worker startup optimization without evidence of an urgent outage or broken user workflow.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies this as maintainer-authored, so the external-contributor proof gate does not apply. The captured body additionally reports real plugin-CLI timing and successful AWS worker activation; those observations precede the rebase and were not rerun here.

Evidence

What I checked:

  • Verified introduced production change: The pinned base-to-head diff moves only runtime-link publication past successful plugin activation. Occupied-path validation remains before activation, and publication remains before node launch. (extensions/crabbox/src/crabbox-worker-node-enrollment.ts:329, 84493dae713c)
  • Doctor explains the performance mechanism: The pristine-state predicate accepts only the config entry; any runtime link makes it select the full migration path. Existing state and migration-bearing configuration still reject the shortcut. The patch changes the producer’s ordering without weakening Doctor’s predicate. (src/commands/doctor/shared/pristine-startup-state.ts:227, 84493dae713c)
  • Current main still publishes early: Fetched main still creates the runtime symlink before the plugin activation loop, so the central optimization remains outstanding. (extensions/crabbox/src/crabbox-worker-node-enrollment.ts:333, 069710f909f0)
  • Latest release retains the old ordering: The supplied latest release, v2026.9.4, also publishes the runtime link before plugin activation. (extensions/crabbox/src/crabbox-worker-node-enrollment.ts:333, 3a9d69db306c)
  • Regression coverage exercises generated bootstrap: Added cases preserve occupied files/directories and reject activation failure without publishing runtime or node PID. The successful enrollment case checks publication after activation. These execute the generated bootstrap against a synthetic package; they are supplemental tests, not independent live performance proof. (extensions/crabbox/src/crabbox-worker-node-enrollment.test.ts:458, 84493dae713c)
  • Captured behavior evidence and review continuity: The supplied body at sourceRevision c559a80d5940562135efb128b67911235221d502a35f8f8255daa91936cd4041 reports three alternating generated-bootstrap/real-plugin-CLI runs, activation medians of 3.98 versus 2.17 seconds, existing-state and failure checks, and a successful fresh AWS Linux worker session. It explicitly distinguishes synthetic installation/final-node fixtures and pre-rebase live evidence from current-head tests. Prior review projection contains no findings. The earlier reviewed commit could not be loaded locally, so patch identity across that rebase was not independently verified. (84493dae713c)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-14T05:42:38.855Z sha 7d64db5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T06:29:00.269Z sha 7d64db5 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T06:58:39.079Z sha d5cdb66 :: blocked before merge. :: none
  • reviewed 2026-09-14T07:22:05.282Z sha ee655e1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-14T07:43:27.911Z sha 4a4ddf0 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/cloud-startup-next-speed branch from 7d64db5 to d5cdb66 Compare September 14, 2026 06:48
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S and removed size: XS labels Sep 14, 2026
@steipete steipete self-assigned this Sep 14, 2026
@steipete
steipete force-pushed the codex/cloud-startup-next-speed branch from 4a4ddf0 to 84493da Compare September 14, 2026 07:51
@openclaw-barnacle openclaw-barnacle Bot added size: XS and removed app: web-ui App: web-ui size: S labels Sep 14, 2026
@steipete
steipete merged commit 7066d66 into main Sep 14, 2026
108 checks passed
@steipete
steipete deleted the codex/cloud-startup-next-speed branch September 14, 2026 08:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 14, 2026
* commit 'a08cdc50bc049074ed7ad2db9e18e0ed3f5415ec': (81 commits)
  perf: reuse stateless plugin scope defaults (#148080)
  fix(gateway): flush slow-consumer 1008 close frame before terminating socket (#147707)
  fix: keep model catalogs loading during other session updates (#147878)
  fix: show queued external chat messages and their source (#147848)
  refactor(chat): share math label configuration (#148073)
  perf(ui): trim eager debug overlay icon payload (#147954)
  improve(logbook): sample batch frame metadata in SQLite (#147999)
  fix(ui): dismiss suggested task cards without waiting (#148021)
  fix(maturity): cover governance, interoperability, fleet, and state (#143528)
  chore(ui): restore core lint and startup budget checks (#148010)
  fix: chat startup loads unnecessary session setup text (#147973)
  perf: speed up fresh cloud worker activation (#147945)
  fix: recover PR preparation after committed merge conflicts (#148063)
  test(plugins): isolate ClawHub Docker fixture identity (#148074)
  fix(release): acknowledge ClawHub risk on moving installs (#148041)
  fix: restore context reads for installed official Discord and Slack plugins (#143341)
  fix: identify source capsule filesystem failures (#147778)
  fix(linux): keep Quick Chat widgets bound to their Gateway (#146049)
  refactor(infra): consolidate update campaign reset ownership (#146555)
  refactor: simplify Gateway health response parsing (#147834)
  ...
vincentkoc added a commit to nvtoroy/openclaw that referenced this pull request Sep 15, 2026
* commit '7d485aa2e89af7fdbd09e8ed0489b06d250b07e3':
  test(scripts): check the configurable ClawHub sweep spec
  fix: show queued external chat messages and their source (openclaw#147848)
  refactor(chat): share math label configuration (openclaw#148073)
  perf(ui): trim eager debug overlay icon payload (openclaw#147954)
  improve(logbook): sample batch frame metadata in SQLite (openclaw#147999)
  fix(ui): dismiss suggested task cards without waiting (openclaw#148021)
  fix(maturity): cover governance, interoperability, fleet, and state (openclaw#143528)
  chore(ui): restore core lint and startup budget checks (openclaw#148010)
  fix: chat startup loads unnecessary session setup text (openclaw#147973)
  perf: speed up fresh cloud worker activation (openclaw#147945)
  fix: recover PR preparation after committed merge conflicts (openclaw#148063)
  test(plugins): isolate ClawHub Docker fixture identity (openclaw#148074)
  fix(release): acknowledge ClawHub risk on moving installs (openclaw#148041)
  fix: restore context reads for installed official Discord and Slack plugins (openclaw#143341)
  fix: identify source capsule filesystem failures (openclaw#147778)
  fix(linux): keep Quick Chat widgets bound to their Gateway (openclaw#146049)
  refactor(infra): consolidate update campaign reset ownership (openclaw#146555)
  refactor: simplify Gateway health response parsing (openclaw#147834)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: crabbox maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant