Skip to content

fix: restore failing worker recovery tests - #164029

Closed
roboclaw-bot wants to merge 1 commit into
mainfrom
roboclaw/worker-fence-fixtures-b853
Closed

roboclaw-bot wants to merge 1 commit into
mainfrom
roboclaw/worker-fence-fixtures-b853

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Related: #160108

What Problem This Solves

Fixes failing worker-recovery tests after main removed redundant pre-renewal workspace verification.

User Impact

No production behavior changes. Restores CI coverage for preserving worker results when verification fails after application, and for retrying unchanged results safely. No recovery assertions, timeouts, or exclusions are weakened.

Why This Change Was Made

The tests injected failure on the third remote-verification call, which no longer occurs. The shared harness now injects a one-shot failure at the intended remote, local, or post-application boundary. Post-application injection is armed only after the journal commit resolves. Reclaim ordering is asserted from the start of that phase rather than a fixed-length log tail.

This is a separate main-line CI repair. The required normal direct-main push was refused with GH013: “Changes must be made through a pull request”; no bypass or force push was attempted.

Evidence

Candidate: ae0e07732858f5b9e5062341b3490f654833a27a, based on 12d823be3f07e90e2b55bf76c9f9dbbeca285a0d. Four test/harness files, +24/−16; production files unchanged.

  • Exact CI base 4a0be71e57ab19d08518879dcab11c5e9c798cd6: lifecycle file reproduced both failures (29 passed / 2 failed), 87.06s wrapper wall. Unchanged-base sibling reproduction produced four related failures in 19.68s. The same failures appear in scheduled main CI.
  • Repaired lifecycle, dispatch, reclaim, and workspace-finalize files: 118/118 passed, 146.84s wrapper wall on base de2f83e2713ada8b7c693ebd920eb73f76898063. The patch remained byte-identical through the later main advance.
  • Final publication base: both post-apply lifecycle cases passed in 29.33s; all four affected test-type graphs passed in 66.05s.
  • Targeted lint, formatting, diff check, size and assertion-safety checks passed. Native independent review: scoped-clean through P2. No CI rerun or dispatch was used as proof.
  • Test command: node scripts/run-vitest.mjs src/gateway/server.sessions.worker-placement-lifecycle.test.ts src/gateway/worker-environments/placement-dispatch.test.ts src/gateway/worker-environments/placement-dispatch-reclaim.test.ts src/gateway/worker-environments/workspace-finalize.test.ts --maxWorkers=1. Wrapper timings above include preparation; new-PR CI seconds are not yet available.

Contributor

Prepared during CI triage requested by @galiniliev; the commit retains the verified human co-author credit.

Work sessions

Inject verification failures at semantic phases rather than call counts, and
assert the complete reclaim phase while preserving recovery expectations.

Co-authored-by: galiniliev <[email protected]>
@clawsweeper

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

@clawsweeper

clawsweeper Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 12:18 AM ET / 04:18 UTC.

ClawSweeper review

What this changes

The PR repairs worker-recovery tests by injecting verification failures at named phases and checking the complete reclaim sequence.

Merge readiness

✅ Ready for maintainer review

This focused test repair remains necessary on current main. The revised fault injection matches the production recovery phases, preserves the substantive assertions, and introduces no identified correctness defect.

Priority: P2
Reviewed head: ae0e07732858f5b9e5062341b3490f654833a27a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable fixture correction with preserved recovery assertions and reported focused validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This bot-authored fixture repair changes no production behavior, so the ordinary contributor runtime-proof gate does not apply. Reported tests exercise the production reclaim and deletion owners through mocked worker transport; they are supplemental validation. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This bot-authored fixture repair changes no production behavior, so the ordinary contributor runtime-proof gate does not apply. Reported tests exercise the production reclaim and deletion owners through mocked worker transport; they are supplemental validation. No stored-data contract changes.
Evidence reviewed 8 items Verified introduced scope: The pinned merge-base-to-head diff changes only tests and their shared harness. Production code, dependencies, configuration, and persistence contracts are unchanged.
Production verification sequence: The current-main finalizer verifies remotely after lease renewal and again after application; it no longer performs a third remote verification. Its unchanged-result path verifies remote state and then accepts through the local check.
Semantic fault injection: The harness consumes remote or local failures once. The post-application failure becomes eligible only after the awaited journal commit resolves, so the real finalizer reaches its preserve-result failure disposition.
Findings None None.
Security None None.

How this fits together

The Gateway reconciles worker workspace changes before stopping a worker or deleting its session. These tests verify that failed final checks retain recovery state and that unchanged results can be retried safely.

flowchart TD
  A[Stop or delete request] --> B[Worker workspace reconciliation]
  B --> C[Renew lease and verify workspaces]
  C --> D[Apply changed result]
  D --> E[Final verification]
  E --> F[Accept result and stop worker]
  E --> G[Retain recovery state on failure]
  H[Test fault injection] --> C
  H --> E
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +8. Total +8 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 24 16 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 24 16 +8

Review metrics

None.

Technical review

Best possible solution:

Keep recovery coverage aligned with the existing finalizer through phase-based faults, preserving result retention, retry behavior, and deletion safeguards.

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

Yes, from source: current main's two remote verification calls cannot trigger the fixtures configured to fail on call three. The PR also reports baseline failures; this read-only review did not execute tests.

Is this the best way to solve the issue?

Yes. Injecting faults at the existing remote, local, and post-commit boundaries repairs the fixture owner without undoing the intentional production optimization.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded repair of failing recovery fixtures with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This is a bounded repair of failing recovery fixtures with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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.

@RomneyDa
RomneyDa deleted the roboclaw/worker-fence-fixtures-b853 branch October 22, 2026 03:22
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