Skip to content

RFC21: Prevent competing volume writes during embedded Gateway recovery - #3773

Open
stevenlee-oai wants to merge 3 commits into
mainfrom
dev/stevenlee/embedded-gateway-owner-recovery
Open

stevenlee-oai wants to merge 3 commits into
mainfrom
dev/stevenlee/embedded-gateway-owner-recovery

Conversation

@stevenlee-oai

@stevenlee-oai stevenlee-oai commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Two containers can write the same ordinary Docker volume even after the original Gateway has stopped. This RFC21 follow-up asks how Compute could prevent competing writers from attaching to embedded Agent state while a replacement recovers. Compute and runtime maintainers can review this storage guarantee separately from Gateway managed mode. Proposal

OCE #2982 accepts temporary operator recovery after an embedded hard crash. OCE #2633 implements unattended recovery for a verified Docker predecessor and the first Gateway container restarted by kubelet in the same Pod. Both cases passed its restart check at bb403839. A new Pod with an unverifiable owner requires operator confirmation. #3355 covers dedicated Gateway state. Managed mode #2982 · Unattended recovery #2633 · Passing restart check · Dedicated recovery #3355

On Docker Engine 29.9.0, the stopped Gateway retained its name and was the only listed attachment. A differently named initializer then mounted the same volume and wrote a marker. A separate reader saw the write. The proposal describes how to test a storage mechanism against that case. No provider mechanism has been selected.

@clawsweeper

clawsweeper Bot commented Oct 26, 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.

@stevenlee-oai
stevenlee-oai requested a review from a team October 26, 2026 18:29
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR proposes provider-verified recovery of embedded Gateway state after an unclean stop and links the plan from RFC-0021.

Example: An embedded Gateway using OpenClaw 9cc4450e is killed and replaced on its retained state volume.

  • Before: The replacement cannot verify the foreign-namespace owner and refuses automatic takeover.
  • After: The proposal permits automatic confirmation only after Compute proves exact predecessor termination and exclusive volume custody; otherwise an operator confirms recovery.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, bounded proposal with no concrete introduced defect; the provider custody mechanism remains an explicit design decision.
Proof confidence 🌊 off-meta tidepool Not applicable: This PR changes specifications only and claims no unattended implementation; the inspected linked screenshot shows simulated managed-mode UI, and its video preparation failed with ffprobe ENOENT with no browser tool available, neither affecting this proposal's proof requirements.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Docs · Worth it: Yes
User problem: An embedded Gateway replacement can remain unavailable after an unclean stop because retained locks belong to an unverifiable process in another PID namespace.
Reason: The maintainer-authored proposal records a concrete rollout dependency and the necessary safety boundary without claiming implementation or provider qualification.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep this PR open for Compute and runtime design review: it identifies a concrete recovery boundary, preserves operator confirmation when custody is uncertain, and introduces no runtime changes.

Priority: P2
Reviewed head: e5c0c5c90d4cace9616232706f68e6757e86342d
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Which deployment mechanism can enforce exclusive volume access across the embedded Gateway, workspace initializer, and other Docker clients throughout recovery?
  • Recommendation: Qualify enforceable provider custody: Compute and runtime owners identify an enforceable deployment boundary and retain the disabled automation gate until its success and competing-writer cases pass.
  • Why: The proposal explicitly leaves this mechanism open because container-name reservation and a one-time attachment inventory do not prevent another writer.

Before merge

  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

None.

Agent review details

How this fits together

Compute manages Agent workloads and retained volumes; the proposed bootstrap would combine provider custody evidence with OpenClaw's fingerprinted recovery command before admitting model work.

flowchart TB
  A[Stopped embedded Gateway] --> B[Retained Agent state]
  C[Compute Driver] -. verifies termination and custody .-> D[Proposed trusted bootstrap]
  B -. inspected locks .-> D
  D -. qualified custody .-> E[Native recovery and first chat]
  D -. unresolved custody .-> F[Operator confirmation]
Loading

Technical review

Best possible solution:

Keep automatic recovery disabled until a provider can enforce exclusive custody throughout handoff and qualify successful recovery plus competing-writer refusals.

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

No runtime reproduction is required for this documentation-only PR; source inspection confirms the shared-volume initializer and heartbeat-aging test assumptions, while the linked failed job belongs to the managed-mode branch.

Is this the best way to solve the issue?

The proposal uses the existing Compute lifecycle and native fingerprinted recovery command, correctly separating exact termination from exclusive custody and preserving operator recovery when either cannot be established.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 1bd061c09f1c.

Provenance checked

Security

None.

Evidence

What I checked:

Labels

Label changes:

  • add P2: This scoped design proposal addresses retained-state restart qualification without changing current runtime behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Label justifications:

  • P2: This scoped design proposal addresses retained-state restart qualification without changing current runtime behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on maintainer: Only explicit maintainer approvals or decisions remain; merge is still blocked.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 26, 2026, 2:40 PM ET / 18:40 UTC.

@stevenlee-oai
stevenlee-oai marked this pull request as ready for review October 26, 2026 20:24
@stevenlee-oai stevenlee-oai changed the title RFC21: Propose recovery for embedded Gateway state after an unclean stop RFC21: Prevent competing volume writes during embedded Gateway recovery Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants