Skip to content

fix(gateway): recover cloud worker placement state - #120976

Merged
steipete merged 2 commits into
mainfrom
steipete/cloud-env-observability-redispatch
Aug 9, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/cloud-env-observability-redispatch

Conversation

@steipete

@steipete steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Cloud worker lifecycle state could become stale or permanently terminal in four gateway paths:

  • post-destroy placement reconciliation dropped the environment ID and could collapse into an older full sweep;
  • failed worker details were hidden from environment inventory responses;
  • a settled tunnel reconnect loop could remain reported as reconnecting;
  • dispatches interrupted during requested, provisioning, or syncing became permanently failed even after their environment was proven gone.

Why This Change Was Made

The gateway now keeps periodic full reconciliation coalesced while serializing each targeted reconciliation as a fresh pass. Failed placement redispatch reuses the existing generation bump and identity reset, but is admitted only through the same fail-closed environment-gone proof used by session deletion. Worker failure details are redacted and bounded at the service projection, and tunnel liveness tracks actual loop settlement.

User Impact

Operators can explicitly redispatch a failed cloud placement after teardown is proven, while a still-live or unprovable environment remains safely fenced with an actionable Stop cloud worker message. Environment listings expose bounded terminal failure context, and tunnel status no longer claims an abandoned reconnect loop is live.

This PR is gateway-only and makes no Control UI changes.

Evidence

  • Focused gateway and protocol suite: 212 tests passed.
  • Dispatch-abort and SDK coverage: 42 tests passed.
  • Follow-up requested/provisioning/syncing recovery coverage: 79 tests passed.
  • Tunnel settlement regression: 12 tests passed.
  • Touched TypeScript files pass node scripts/run-oxlint.mjs.
  • Protocol registry, TypeScript generation, Swift generation check, Kotlin generation, and protocol-since guard pass.
  • git diff --check passes.
  • Codex autoreview: no accepted or actionable findings.

Related: #120953

@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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: M maintainer Maintainer-authored PR labels Aug 9, 2026
@steipete
steipete marked this pull request as ready for review August 9, 2026 07:17
@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 merged commit 411777d into main Aug 9, 2026
120 checks passed
@steipete
steipete deleted the steipete/cloud-env-observability-redispatch branch August 9, 2026 08:01
@steipete

steipete commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 10, 2026
* fix(gateway): recover cloud worker placement state

Related: openclaw#120953

* test(gateway): type failed placement fixture

Related: openclaw#120953
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 gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant