Skip to content

feat: show cloud snapshot startup progress - #170895

Merged
steipete merged 2 commits into
mainfrom
snap/start-status
Oct 13, 2026
Merged

steipete merged 2 commits into
mainfrom
snap/start-status

Conversation

@steipete

@steipete steipete commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cloud sessions use the same provisioning text for a snapshot fork, first repository setup, and checkpoint capture. Operators also cannot see the last cold-start reason in the snapshot listing.

Solution

Record a typed start status at the Crabbox allocation decision and carry it through the existing worker environment and session placement channels. The existing startup line shows “Starting from snapshot…”, “Preparing cloud environment…”, or “Saving snapshot…” for the corresponding phases. Other startup text and New Session stay unchanged.

Persist an optional cold reason on the existing plugin-owned image/allocation records and expose latestColdReason in crabbox.images.list. Reasons come from the allocation facts: no snapshot yet, changed setup, retirement, unavailable snapshot, unsupported OS/backend, disabled images, paused capture, or unknown machine class. Capture callbacks preserve the allocation mode and restore it when capture ends.

Impact

First-machine capture still happens before enrollment. Runtime top-up after a snapshot fork stays owned by the provider's shared runtime preparation. Startup status is transient and belongs to the current provisioning attempt; stale attempts cannot publish status. Existing image records keep their v3 format and optional missing cold reasons remain unknown. There are no config, SQLite schema, or updater changes.

No extra chips, banners, Settings changes, or New Session text. The optional snapshot-age hover line is skipped because the picker has no repository snapshot data without another RPC. The integrated live AWS proof remains with the lead.

Evidence

Rebased onto main after #170780 merged (1c5e7a482910c15d041e04a3c7279b055fc4df26); source files merged cleanly and the documentation conflict retained both status reporting and runtime-top-up explanations. Local extension lint hit its Plugin SDK declaration prerequisite timeout (plugin-sdk boundary dts timed out after 300000ms); the lead explicitly accepted disk contention and assigned extension lint to PR CI. No budget, baseline, guard, inventory, or cap changes.

A second rebase resolved a real conflict with #170820 while preserving its retry countdown and failure actions. The prior-head CI identified two defects in this patch: extension property shorthand and a nullable E2E fixture timestamp. Both are fixed. Main's recovery changes also left the pane at 702 lines against its 700-line lint limit; reusing the existing placement variable keeps the formatted result at the limit without changing any cap or unrelated code.

Final repair proof:

  • pnpm test ui/src/pages/chat/components/chat-message.startup.test.ts ui/src/pages/chat/chat-history.recovery-status.test.ts ui/src/e2e/chat-startup-progress.e2e.test.ts --maxWorkers=1 — 12 passed after the second rebase in 337.30 s; 12 passed after CI repairs in 130.34 s.
  • node scripts/run-tsgo-core-test-shards.mjs --ci-graphs-json '["core-test-ui-e2e-chat"]' --concurrency 1 — the failed graph passed, 25.36 s.
  • pnpm tsgo:ui — passed after the second rebase, 63.66 s.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/pages/chat/chat-pane-render.ts ui/src/pages/chat/chat-run-startup.ts ui/src/pages/chat/chat-view.ts ui/src/e2e/chat-startup-progress.e2e.test.ts — passed, 43.45 s.
  • node scripts/run-oxlint.mjs --tsconfig extensions/tsconfig.json extensions/crabbox/src/crabbox-worker-warm-image-allocation.ts — passed, 345.61 s. The package-boundary declarations completed on this attempt.
  • pnpm format:check -- extensions/crabbox/src/crabbox-worker-warm-image-allocation.ts ui/src/e2e/chat-startup-progress.e2e.test.ts ui/src/pages/chat/chat-pane-render.ts — passed, 1.18 s.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/pages/chat/chat-pane-render.ts — formatted final pane passed at the 700-line limit, 32.46 s.
  • pnpm check:line-cap-ratchet --base HEAD^ — passed, 3.66 s; git diff --check passed.
  • Fresh independent Codex review of the staged repairs — no actionable P0–P2 findings; only canonical line wrapping followed.

Post-rebase proof:

  • pnpm test extensions/crabbox/src/crabbox-worker-warm-image-allocation.test.ts extensions/crabbox/src/crabbox-worker-warm-image-lifecycle.test.ts extensions/crabbox/src/crabbox-worker-prepared-image.test.ts src/gateway/worker-environments/provider-provisioning.test.ts src/gateway/worker-environments/repository-project-access.test.ts ui/src/pages/chat/components/chat-message.startup.test.ts --maxWorkers=1 — 72 passed, 629.22 s. Includes compatible older-runtime fork top-up coverage from fix(crabbox): preserve project snapshots across runtime updates #170780.
  • pnpm tsgo — passed, 55.00 s; pnpm tsgo:extensions — passed, 338.08 s; pnpm tsgo:ui — passed, 95.72 s.
  • pnpm format:check -- docs/gateway/cloud-workers/warm-images.md docs/plugins/sdk-runtime.md extensions/crabbox/src/crabbox-worker-provider.ts extensions/crabbox/src/crabbox-worker-warm-image-allocation.test.ts extensions/crabbox/src/crabbox-worker-warm-image-allocation.ts extensions/crabbox/src/crabbox-worker-warm-image-capture.ts extensions/crabbox/src/crabbox-worker-warm-image-store.ts extensions/crabbox/src/crabbox-worker-warm-image.ts packages/gateway-protocol/src/schema/environments.ts packages/gateway-protocol/src/schema/session-placement.ts src/gateway/server-methods/session-placement-read-projection.ts src/gateway/worker-environments/environment-access.ts src/gateway/worker-environments/environment-summary.ts src/gateway/worker-environments/placement-projector.ts src/gateway/worker-environments/provider-lifecycle.ts src/gateway/worker-environments/provider-provisioning.test.ts src/gateway/worker-environments/repository-project-access.test.ts src/gateway/worker-environments/service-contract.ts src/gateway/worker-environments/service.ts src/plugins/capability-provider.types.ts ui/src/app/session-placement-startup.runtime.ts ui/src/app/session-placement-startup.ts ui/src/e2e/chat-startup-progress.e2e.test.ts ui/src/i18n/locales/en.ts ui/src/pages/chat/chat-pane-render.ts ui/src/pages/chat/chat-run-startup.ts ui/src/pages/chat/chat-view.ts ui/src/pages/chat/components/chat-message.startup.test.ts — passed, 1.72 s; targeted node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json packages/gateway-protocol/src/schema/environments.ts packages/gateway-protocol/src/schema/session-placement.ts src/gateway/server-methods/session-placement-read-projection.ts src/gateway/worker-environments/environment-access.ts src/gateway/worker-environments/environment-summary.ts src/gateway/worker-environments/placement-projector.ts src/gateway/worker-environments/provider-lifecycle.ts src/gateway/worker-environments/provider-provisioning.test.ts src/gateway/worker-environments/repository-project-access.test.ts src/gateway/worker-environments/service-contract.ts src/gateway/worker-environments/service.ts src/plugins/capability-provider.types.ts ui/src/app/session-placement-startup.runtime.ts ui/src/app/session-placement-startup.ts ui/src/e2e/chat-startup-progress.e2e.test.ts ui/src/i18n/locales/en.ts ui/src/pages/chat/chat-pane-render.ts ui/src/pages/chat/chat-run-startup.ts ui/src/pages/chat/chat-view.ts ui/src/pages/chat/components/chat-message.startup.test.ts — passed, 125.02 s.
  • pnpm ui:i18n:verify — passed, 31.54 s; pnpm check:line-cap-ratchet --base HEAD^ — passed, 3.65 s; pnpm check:max-lines-ratchet --base HEAD^ — passed, 104.80 s; git diff --check HEAD^ HEAD — passed, 0.50 s.
  • pnpm test ui/src/e2e/chat-startup-progress.e2e.test.ts --maxWorkers=1 — 3 passed, 149.92 s; includes a production Control UI build and mocked session placement transitions.
  • Fresh independent Codex review of the rebased patch — no actionable P0–P2 findings.

Pre-rebase proof:

  • pnpm test extensions/crabbox/src/crabbox-worker-warm-image-allocation.test.ts extensions/crabbox/src/crabbox-worker-warm-image-lifecycle.test.ts src/gateway/worker-environments/provider-provisioning.test.ts src/gateway/worker-environments/repository-project-access.test.ts ui/src/pages/chat/components/chat-message.startup.test.ts --maxWorkers=1 — 60 passed, 219.09 s.
  • pnpm test src/gateway/worker-environments/provider-provisioning.test.ts ui/src/pages/chat/components/chat-message.startup.test.ts --maxWorkers=1 — 26 passed, 443.81 s after the final projection/reconnecting guard changes.
  • OPENCLAW_CAPTURE_UI_PROOF=1 pnpm test ui/src/e2e/chat-startup-progress.e2e.test.ts --maxWorkers=1 — 3 passed, 134.93 s.
  • pnpm build runtime — passed, 477.35 s. Full package declarations were interrupted under contention; runtime build completed.
  • pnpm tsgo — passed, 591.78 s; pnpm tsgo:ui — passed, 713.70 s; pnpm tsgo:extensions — passed, 94.82 s.
  • Targeted core/UI oxlint, touched-file pnpm format:check, pnpm ui:i18n:verify, pnpm check:line-cap-ratchet --base HEAD, pnpm check:max-lines-ratchet --base origin/main, and git diff --check — passed.
  • Independent Codex review — no actionable P0–P2 findings.

Inspected synthetic mocked Control UI captures prove the status labels. The fixture's epoch-derived elapsed age is not timing evidence.

Before:

Before: generic cloud provisioning

After, snapshot fork:

After: starting from snapshot

After, first repository preparation:

After: preparing cloud environment

After, capture in progress:

After: saving snapshot

Release-note context

Cloud session startup now distinguishes snapshot forks, repository preparation, and snapshot capture in its existing status line. Snapshot details can report the latest reason a repository started cold.

@clawsweeper

clawsweeper Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T09:55:15.281314Z 44db2bb New commits
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime plugin: file-transfer extensions: crabbox size: L labels Oct 13, 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: 44db2bb64c

ℹ️ 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 +433 to +434
if (claimed) {
context.onCaptureEnd?.();

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 Restore startup status after a successful capture

When a project snapshot is captured successfully, the publish path sets claimed = false before reaching this check, so onCaptureEnd is never called. The provisioning status therefore remains saving throughout source restoration, node enrollment, and bootstrap—potentially for many minutes—until the entire provider attempt settles. Track whether onCaptureStart ran, or call the end callback directly after successful publication, rather than gating it on the current claim flag.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 28f455f into main Oct 13, 2026
146 of 151 checks passed
@steipete
steipete deleted the snap/start-status branch October 13, 2026 11:01
@steipete

Copy link
Copy Markdown
Contributor Author

Merged with a pinned-head REST squash on 44db2bb64c76dc0483b713af4551100e9f27845f. All required checks, including openclaw/ci-gate, were green on that head and the lead review was clean. The native route refused only because GitHub reported UNSTABLE from non-required runs: three cancelled ClawSweeper dispatch runs (queued runs cancelled by the concurrency group during bot review events) and superseded PR context and evidence runs, whose latest run passed after the body heading fix.

steipete added a commit that referenced this pull request Oct 14, 2026
Shares the snapshot status rule between repository summaries and snapshot rows, and shares unassigned-preparation eligibility between repository grouping and unlabeled builds. Removes duplicate label arguments, a redeclared action props type, naming-only accessors, an input-only form-control helper, singleton fragments and consecutive store updates. Net production change: -41 lines across four Control UI files. No user-visible behavior change.

Related: #170892, #170895, #170875, #171176
Refs: #171684
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
Cloud sessions now say whether they start from a snapshot. The warm-image allocation records the start mode and, for cold starts, one reason from a closed set (no-snapshot-yet, setup-changed, snapshot-retiring, snapshot-unavailable, os-unsupported, warm-images-off, capture-paused, backend-cannot-snapshot, class-unknown). An optional provider callback scoped to the provisioning attempt reports provisioning, preparing and saving phases into environment summaries and session placement.

The existing startup status line reads "Starting from snapshot..." for forks, and "Preparing cloud environment..." then "Saving snapshot..." for a first run that captures. Cold reasons appear only in detail surfaces; New Session gains no visible text.

Refs: openclaw#170895
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 14, 2026
Shares the snapshot status rule between repository summaries and snapshot rows, and shares unassigned-preparation eligibility between repository grouping and unlabeled builds. Removes duplicate label arguments, a redeclared action props type, naming-only accessors, an input-only form-control helper, singleton fragments and consecutive store updates. Net production change: -41 lines across four Control UI files. No user-visible behavior change.

Related: openclaw#170892, openclaw#170895, openclaw#170875, openclaw#171176
Refs: openclaw#171684
wangmiao0668000666 added a commit to wangmiao0668000666/openclaw that referenced this pull request Oct 18, 2026
…ried

A retried placement kept the failed attempt's start time, so the elapsed
timer in the startup status and the working indicator counted the dead
time between the failed attempt and the retry. The entry now tracks the
message creation time and the attempt start separately: Retry keeps the
message timestamp (even when a rejected send rotates the message id) and
restarts only the attempt clock, and the attempt-start override is scoped
to the placement turn so an ordinary send still counts its acknowledgment
wait from the message time.

Rebased onto main after the shared-UI consolidation (openclaw#167925), the cloud
snapshot startup progress (openclaw#170895), and the progress-totals fix
(openclaw#172492): the retry regression tests moved into
session-placement-startup.stop.test.ts with the rest of the placement
Retry suite, and the snapshot startStatus payload is preserved alongside
the reset attempt clock.

Co-Authored-By: Claude Code <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation extensions: crabbox gateway Gateway runtime plugin: file-transfer size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant