Repository navigation
feat: show cloud snapshot startup progress - #170895
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
8c07ef9 to
44db2bb
Compare
There was a problem hiding this comment.
💡 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".
| if (claimed) { | ||
| context.onCaptureEnd?.(); |
There was a problem hiding this comment.
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 👍 / 👎.
|
Merged with a pinned-head REST squash on |
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
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
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
…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]>
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
latestColdReasonincrabbox.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 --checkpassed.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; targetednode 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.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.pnpm format:check,pnpm ui:i18n:verify,pnpm check:line-cap-ratchet --base HEAD,pnpm check:max-lines-ratchet --base origin/main, andgit diff --check— passed.Inspected synthetic mocked Control UI captures prove the status labels. The fixture's epoch-derived elapsed age is not timing evidence.
Before:
After, snapshot fork:
After, first repository preparation:
After, capture in progress:
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.