Skip to content

fix(ui): make Cloud Worker startup responsive - #121200

Merged
steipete merged 11 commits into
mainfrom
steipete/cloud-worker-creation-and-syncing-4c67b9
Aug 10, 2026
Merged

steipete merged 11 commits into
mainfrom
steipete/cloud-worker-creation-and-syncing-4c67b9

Conversation

@steipete

@steipete steipete commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

No issue: this is a bounded maintainer-requested bug fix.

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Fixes an issue where users starting a Cloud Worker session could remain on an inert /new page throughout worker provisioning, with no durable progress and failures that could disappear with the route. It also fixes the user-reported live error where selecting GPT-5.6 High could be rejected as unsupported after ChatGPT catalog discovery admitted Platform-only alias rows with incorrect reasoning metadata.

Why This Change Was Made

There were two owner-boundary failures:

  1. The OpenAI plugin admitted Platform-only bare gpt-5.6 and chat-latest rows into the ChatGPT catalog. A bare row without reasoning metadata published reasoning: false, so generic validation correctly rejected High. Catalog admission now filters those Platform-only IDs while preserving the authoritative metadata of valid ChatGPT models.
  2. NewSessionPage synchronously owned durable session creation, worker dispatch/provision/sync/start, first send, and navigation. The application-lifetime Cloud startup coordinator now owns continuation after durable session creation. The page navigates immediately, Gateway-owned durable placement transitions flow through coalesced sessions.changed events, canonical requested/provisioning/syncing/starting/sending progress renders in the created session, and the initial message is sent only after active ownership. Runtime ownership is isolated per canonical session key, and framed v2 recovery records persist per session so reconnect and stale-client takeover cannot cancel or delete another session's work. Legacy migration rolls back safely if the replacement record cannot be committed.

The rebase resolution also preserves the latest main route-owned draft behavior, including destination-owned input, terminal startup, and worktree creation. This changes no config, protocol, generated baseline, or performance budget.

User Impact

Cloud Worker startup now has an immediate visible destination and clear progress instead of appearing frozen. The accepted prompt survives route changes exactly once, send waits for active worker ownership, and terminal startup failures remain visible in the created session. Valid GPT-5.6 ChatGPT models retain their supported High reasoning capability.

Evidence

Synthetic after screenshot

Synthetic Control UI Cloud session with High effort selected

The user-provided before screenshot was reproduced live but is omitted from this public PR because signed-in session/sidebar data could not be safely captured. The attached after screenshot is synthetic and contains only fixture identities.

Focused and browser proof

  • Final per-session durability/reconnect coverage — 89 focused tests passed.
  • Cloud browser E2E — 8 tests passed locally and on AWS: https://crabbox.openclaw.ai/portal/runs/run_4be18ef40305
  • AWS UI build — https://crabbox.openclaw.ai/portal/runs/run_718d6fc92a92 — 324,672 B gzip under the current 325,632 B ceiling.
  • Focused final coverage across the affected Control UI, Gateway, and OpenAI paths — 302 tests passed.
  • node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/new-session-page.cloud-startup.e2e.test.ts ui/src/e2e/new-session-page.cloud-startup-failure.e2e.test.ts — 9 browser E2E tests passed.
  • Blocked-chunk browser proof commits the created chat route and shows pending startup before the runtime loads; dispatch and send remain gated.
  • Two-session same-scope proof advances both Cloud sessions independently with no delete, abort, or environment destroy, while preserving the newer durable recovery record.
  • Reconnect proof covers stale-client takeover, framed v2 per-session migration, exact-key cleanup, and rollback that preserves the legacy record when replacement persistence fails.
  • The focused public OpenAI provider test passes against the shared upstream route contract used to classify catalog aliases.
  • Earlier focused Gateway, Control UI, and OpenAI coverage passed 369 tests; private-observer coverage passed 60 tests; lazy-coordinator coverage passed 10 tests.
  • Source-blind behavior validation passed immediate routing, visible placement phases, send-after-active ownership, stable idempotency, exactly one prompt, route survival, and visible failure.

Static and build proof

  • pnpm build — passed, exit 0.
  • pnpm plugin-sdk:api:check — passed with no API baseline change.
  • pnpm tsgo:ui — passed.
  • UI and test type checks — passed, including recovery-scope readiness and build-info fixture typing.
  • Full UI lint and max-lines checks — passed, including the extracted chat-pane-startup-subscriptions.ts lifecycle owner and notice rendering split.
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json ui/src/pages/new-session/new-session-page.test.ts ui/src/pages/new-session/new-session-page.ts — passed.
  • ./node_modules/.bin/oxfmt --write ui/src/pages/new-session/new-session-page.ts ui/src/pages/new-session/new-session-page.test.ts — passed.
  • git diff --check origin/main...HEAD — passed.
  • Import-cycle and Madge architecture checks report 0 cycles after moving the initial-message contract to its leaf owner; no architecture allowlist was added.
  • Vite config inspection confirms no Cloud-specific chunk naming or modulePreload override; the facade retains multicast Set listeners with add/delete subscription cleanup.
  • The reviewed final repair publishes pending state before the runtime chunk, commits navigation immediately, isolates runtime ownership per session, preserves older concurrent work in memory while the newest durable recovery remains authoritative, and keeps startup subscriptions/notices in focused UI modules.
  • Final P1-level Codex autoreview was clean with no accepted/actionable findings.
  • The pre-durability local pnpm ui:build measured 323,062 B gzip. The final AWS build measured 324,672 B against the current 325,632 B ceiling; this PR changes neither the baseline nor the budget.
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 node scripts/check-changed.mjs --timed passed all selected lanes during the trusted-source local fallback.

Blacksmith Testbox was unavailable for that pre-PR remote verification because the Blacksmith CLI was not installed, so the documented trusted-source local fallback was used and recorded. The mandatory hosted exact-head CI/Testbox gate is still required before merge.

LOC metric

Production LOC: +1999/-905 (net +1094) | Tests: +2020/-270 (net +1750). The positive production delta establishes the application-lifetime continuation owner, per-session runtime ownership, framed v2 durable recovery/migration, and Gateway transition reporting while replacing the route-owned startup/recovery path; file moves also inflate the gross counts.

Remaining live gap

Live GPT-5.6 High remains to be checked after deployment. This PR does not claim deployed live verification.

AI-assisted: yes, using Codex. The final patch and behavior are understood, and no agent transcript is included.

@clawsweeper

clawsweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 9, 2026 18:45
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime extensions: openai size: XL maintainer Maintainer-authored PR labels Aug 9, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 9, 2026
@clawsweeper

clawsweeper Bot commented Aug 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 11:52 PM ET / August 10, 2026, 03:52 UTC.

ClawSweeper review

What this changes

Moves Cloud Worker startup from the new-session page into an application-level coordinator, exposes durable placement progress in chat, and excludes Platform-only aliases from the ChatGPT model catalog.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open. Current main still waits for Cloud dispatch before navigation, and the PR’s owner-boundary direction is sound; however GitHub reports a dirty merge and the required direct Codex-client contract check is unavailable, so this is not ready for a landing verdict.

Priority: P1
Reviewed head: 360faed894e8e96232a8191c7a1cbcf2ef588605

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The reviewed source path and focused coverage are strong, but the unresolved merge and unavailable direct dependency contract prevent a landing recommendation.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR; the synthetic screenshot and mocked browser coverage are useful supplemental evidence but not treated as deployed live proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR; the synthetic screenshot and mocked browser coverage are useful supplemental evidence but not treated as deployed live proof.
Evidence reviewed 4 items Current-main UI behavior: Current main awaits Cloud draft advancement before navigation, so the reported inert-page behavior remains on main.
Catalog owner boundary: The shared route contract classifies only chat-latest and bare gpt-5.6 as Platform-only, while policy rejects those rows on ChatGPT transport; the PR filters them at catalog admission.
Recent area provenance: Recent current-main work on the new-session path is attributed to Peter Steinberger, providing a concrete routing signal for the lifecycle change.
Findings None None.
Security None None.

How this fits together

The Control UI creates a durable session, asks the Gateway to provision a Cloud Worker, then sends the first prompt once ownership is active. The OpenAI plugin converts ChatGPT catalog rows into selectable model capabilities.

flowchart LR
  A[New session form] --> B[Durable session]
  B --> C[Startup coordinator]
  C --> D[Gateway placement]
  D --> E[Chat progress and first send]
  F[ChatGPT catalog] --> G[Route filtering]
  G --> H[Model picker validation]
Loading

Before merge

  • Resolve merge risk (P1) - GitHub reports a dirty merge, so the exact combined behavior with current main has not been reviewed or validated.
  • Resolve merge risk (P1) - The matching Codex client source was unavailable locally and could not be fetched, leaving the external catalog contract unverified.
  • Resolve merge risk (P1) - Production grows by a net 709 lines for a bug fix; the application-lifetime lifecycle owner is plausible, but the resolved merge must retain the route-owned draft behavior from current main.
  • Complete next step (P2) - A conflict resolution and direct Codex dependency-contract inspection are required before any exact-head landing decision; no discrete automated repair is identified.
Agent review details

Security

None.

PR surface

Source +686, Tests +1175, Other +2. Total +1863 across 43 files.

View PR surface stats
Area Files Added Removed Net
Source 27 1435 749 +686
Tests 15 1365 190 +1175
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 43 2802 939 +1863

Review metrics

Metric Value Why it matters
Production versus test delta production +709 net; tests +733 net The lifecycle refactor is substantial for a bug fix and needs exact-head ownership and recovery validation after conflict resolution.

Stored data model

Persistent data-model change detected: durable storage schema: src/gateway/worker-environments/placement-dispatch.test.ts, durable storage schema: src/gateway/worker-environments/placement-dispatch.ts, serialized state: src/gateway/server-methods/sessions-dispatch.ts, serialized state: src/gateway/server-methods/sessions.dispatch.test.ts, serialized state: ui/src/lib/sessions/cloud-recovery-storage-key.ts, serialized state: ui/src/lib/sessions/cloud-recovery.ts, and 9 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Rebase and revalidate the resolved head (recommended)
    Resolve the conflict against current main, inspect the matching Codex client contract, and rerun focused UI, Gateway, and OpenAI checks on the exact resulting SHA.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Rebase onto current main, preserve route-owned drafts, inspect the matching Codex client catalog contract, and rerun focused UI E2E, Gateway placement, and OpenAI catalog validation on the resolved head.

Technical review

Best possible solution:

Rebase onto current main, preserve its route-owned draft behavior, then validate the resolved head’s immediate navigation, per-session recovery, placement transitions, and catalog filtering against the matching Codex client source.

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

Yes, source-reproducible for the UI defect: current main awaits Cloud startup before navigation. I did not run the browser scenario in this read-only review.

Is this the best way to solve the issue?

Unclear for merge readiness: the coordinator is the better owner boundary than a route-local continuation, but the dirty merge and unavailable direct Codex contract check must be resolved first.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 374007083a52.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is not_applicable.

Label justifications:

  • P1: The PR addresses a visible Cloud Worker startup stall and a supported ChatGPT reasoning-selection failure.
  • merge-risk: 🚨 auth-provider: Catalog filtering changes which OAuth-discovered ChatGPT models and reasoning capabilities are selectable.
  • merge-risk: 🚨 session-state: Startup ownership, durable recovery, and initial-message delivery move from page lifetime to application lifetime.
  • 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: This is a maintainer-authored PR; the synthetic screenshot and mocked browser coverage are useful supplemental evidence but not treated as deployed live proof.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the PR’s OpenAI and Cloud-startup commits and recent current-main work in the affected new-session path. (role: recent area contributor; confidence: high; commits: 974f4ff60032, 1fb5d4f1012c, 360faed894e8; files: extensions/openai/openai-provider.ts, ui/src/pages/new-session/new-session-page.ts, src/gateway/worker-environments/placement-dispatch.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Resolve the dirty merge against current main.
  • Validate the resolved head against the matching Codex client source and exact-head checks.

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-08-09T20:51:17.626Z sha 6b55565 :: found issues before merge. :: [P1] Navigate before waiting for the startup chunk | [P1] Keep Cloud startup ownership per session
  • reviewed 2026-08-09T23:02:23.238Z sha 727c128 :: needs changes before merge. :: [P1] Navigate before awaiting the startup runtime | [P1] Key Cloud startup ownership by session
  • reviewed 2026-08-10T01:55:35.037Z sha 360faed :: found issues before merge. :: [P1] Retain queued startup across a gateway drop
  • reviewed 2026-08-10T02:02:09.019Z sha 360faed :: needs maintainer review before merge. :: none
  • reviewed 2026-08-10T03:01:52.773Z sha 360faed :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Aug 9, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 9, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Both prior P1 lifecycle findings are addressed on the current head with blocked-chunk immediate-navigation and two-session same-scope ownership proof.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Both prior P1 lifecycle findings are addressed on the current head, with blocked-chunk immediate-navigation, two-session same-scope ownership, and final facade/Vite architecture proof.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot removed the rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. label Aug 10, 2026
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 10, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 10, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 10, 2026
@openclaw-barnacle openclaw-barnacle Bot reopened this Aug 10, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Aug 10, 2026
@steipete
steipete force-pushed the steipete/cloud-worker-creation-and-syncing-4c67b9 branch from 360faed to 9165413 Compare August 10, 2026 05:08
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head adds per-session v2 durable recovery, stale-client takeover, migration rollback, and exact-key cleanup. Immediate navigation and two-session ownership remain covered; exact-head local and AWS proof is recorded in the PR body.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Current head only applies Oxfmt normalization to ChatProps; the reviewed per-session durability/reconnect behavior and evidence are unchanged. Exact-head native artifacts are refreshed and clean.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Command router queued. I will update this comment with the next step.

@steipete
steipete merged commit b81946d into main Aug 10, 2026
125 checks passed
@steipete
steipete deleted the steipete/cloud-worker-creation-and-syncing-4c67b9 branch August 10, 2026 05:42
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 10, 2026
Worker live events now share compatible Gateway-owned run contexts so the canonical outer terminal can clear session activity after the worker finishing fence. Follow-up to #121200 and #121122.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 11, 2026
* fix(openai): filter platform-only ChatGPT catalog rows

* fix(ui): show Cloud Worker startup progress

* fix(ui): keep cloud startup out of app bootstrap

* fix(ui): reduce cloud startup bootstrap cost

* fix(ui): satisfy cloud startup lint

* fix(ui): keep cloud startup within UI limits

* fix(ui): satisfy cloud startup CI limits

* fix(ui): isolate concurrent cloud startup

* fix(ui): address cloud startup review findings

* fix(ui): persist cloud startup recovery per session

* style(ui): format cloud startup chat props
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 extensions: openai gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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