Skip to content

fix(gateway): reread foreign placement during abandonment - #179448

Merged
Patrick-Erichsen merged 1 commit into
mainfrom
fix-worker-placement-foreign-read
Oct 21, 2026
Merged

Patrick-Erichsen merged 1 commit into
mainfrom
fix-worker-placement-foreign-read

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

When a foreign writer changes a worker placement during forced abandonment, the Gateway can use its older cached placement and fail to fence the remote owner. This makes two move-recovery tests fail on clean main and blocks the agent-selector PR's required CI.

Summary

During forced worker abandonment, a foreign writer can advance a placement while the Gateway still has an older cached replica. Read the current placement and move record before fencing journal owners, pending results, and attached sessions. The recovery assertion also reads the durable placement after its test simulates a foreign SQL claim replacement.

 forceAbandonWorkerEnvironment
-  getAsync(sessionId) // may return an older cached placement
+  getWithMoveAsync(sessionId).placement // current durable owner

This repairs an existing main-branch CI failure blocking the agent selector PR; it does not change that PR's UI scope.

Evidence

  • Before: On clean main 4ee460642678685a83c6e7aaf4a61859a5a4ba6e, placement-dispatch-move-recovery.test.ts fails 2 of 19 tests: concurrent foreign abandonment reads an old active placement, and the claim-replacement assertion reads an old cached claim.
  • After: The same full file passes 19/19 tests with this patch. pnpm tsgo, targeted type-aware oxlint and oxfmt, and pnpm docs:list pass.

Merge Danger

Door: Two-way. Revert restores the previous cache read behavior.

Blast Radius: Worker placement recovery. The fresh reads touch only the forced-abandonment path and one test assertion.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@Patrick-Erichsen

Copy link
Copy Markdown
Contributor Author

@clawsweeper autofix

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

@clawsweeper autofix is retired; ClawSweeper now only reviews.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime size: XS labels Oct 21, 2026
@Patrick-Erichsen
Patrick-Erichsen enabled auto-merge (squash) October 21, 2026 12:08
@Patrick-Erichsen
Patrick-Erichsen merged commit 833702a into main Oct 21, 2026
132 of 133 checks passed
@Patrick-Erichsen
Patrick-Erichsen deleted the fix-worker-placement-foreign-read branch October 21, 2026 12:13
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant