Skip to content

fix(release): restart gateway after migration convergence - #120091

Merged
vincentkoc merged 1 commit into
mainfrom
fix/release-cross-os-migration-restart
Aug 7, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/release-cross-os-migration-restart

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Aug 7, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes an issue where prepublication cross-OS release checks would fail after a manual gateway intentionally exited to converge plugin migration state during first startup.

The failure affected packaged fresh, packaged upgrade, installer manual fallback, and dev-update manual gateway lanes in the 2026.8.1-beta.1 candidate run.

Why This Change Was Made

The release harness now records each manual gateway launch's log offset and retries that launch exactly once only when the child has exited, reached the child-close/stdio-drain boundary, and its flushed current-launch log contains the exact startup-migration refusal prefix. The retry reuses the same home/config, environment, port, CLI, and log path, and replaces the cleanup handle.

Generic exits, paraphrased or stale markers, live readiness failures, and a second refusal still fail. The same bounded path covers the Discord manual gateway relaunch. Managed gateway services are intentionally unchanged; the Windows Scheduled Task failure remains a separate release blocker.

User Impact

Release validation can continue through the gateway's intentional one-time migration convergence restart without hiding unrelated startup failures.

This adds a bounded release-harness capability across the two manual gateway launch owners; it does not change product runtime behavior.

Evidence

  • Failure evidence: cross-OS release run 31131961509 showed the exact startup-migration refusal in all manual gateway lanes after install, onboarding, and model setup completed.
  • node scripts/run-vitest.mjs test/scripts/openclaw-cross-os-release-checks.test.ts - 130 tests passed.
  • Tests cover exact-marker retry, child-close and log-flush ordering, stale/paraphrased/generic rejection, live-child rejection, cleanup-handle replacement, Discord relaunch wiring, and second-refusal failure.
  • pnpm format:check and scoped oxlint passed for all changed scripts.
  • check:changed Testbox delegation could not sync this GWT because omitted tracked paths made the remote checkout unsafe. Its exact trusted local fallback passed all lightweight guards; the full script/test type lanes stopped on unrelated stale shared-checkout errors in untouched files before reaching this change.
  • Final whole-branch autoreview: clean, no accepted/actionable findings.

@vincentkoc vincentkoc self-assigned this Aug 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Aug 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Aug 7, 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 added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. labels Aug 7, 2026
@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed August 6, 2026, 8:40 PM ET / August 7, 2026, 00:40 UTC.

ClawSweeper review

What this changes

The PR adds one exact-marker retry for manual gateways that exit during startup migration convergence in cross-OS release checks.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked by patch quality or review findings - 9 items remain

Keep open: the focused retry addresses the intentional migration exit, but it can race final child output and omits an additional manual gateway relaunch path.

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

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and well-tested at helper level, but two concrete release-path correctness gaps make it not ready to merge.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored release-harness PR is exempt from the external-contributor proof gate; the claimed release run remains useful evidence to rerun after the corrections.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored release-harness PR is exempt from the external-contributor proof gate; the claimed release run remains useful evidence to rerun after the corrections.
Evidence reviewed 6 items Intentional refusal exists on current main: The startup preflight emits the exact migration-convergence refusal before exiting, so the harness defect is source-reproducible rather than a product-runtime failure.
Current harness lacks the recovery: Current main manual readiness paths poll for gateway readiness and do not classify the intentional exited child from its launch log.
Omitted manual relaunch caller: The optional Discord roundtrip starts and stores a new manual gateway but does not pass its holder or log path to the newly gated retry path, so an identical refusal still times out.
Findings 2 actionable findings [P2] Wait for child close before closing the launch log
[P2] Cover the Discord manual gateway relaunch
Security None None.

How this fits together

The cross-OS release harness starts a gateway for fresh-install, upgrade, and installer scenarios, then waits for it to become ready. The changed coordinator reads launch-specific logs to distinguish an intentional convergence exit from an ordinary startup failure.

flowchart LR
A[Release scenario] --> B[Manual gateway launch]
B --> C[Readiness check]
C --> D{Exited with migration marker?}
D -->|First matching exit| E[Restart once]
D -->|Other failure| F[Fail release lane]
E --> G[Continue release checks]
Loading

Decision needed

Question Recommendation
Should this protected release-harness PR be revised to cover the child-close lifecycle and every manual gateway launch owner before release validation relies on it? Repair all manual launch paths: Await final child output, wire the Discord relaunch into the coordinator, and rerun the affected release scenario.

Why: The necessary repairs are concrete, but the maintainer-owned release harness and protected label require an explicit owner decision before accepting changed release behavior.

Before merge

  • Wait for child close before closing the launch log (P2) - exitCode can be set before the child close boundary drains stdout/stderr, but this closes the file stream before reading the marker. The final refusal can therefore be omitted or written after end(), causing the bounded retry to miss the exact failure it is intended to handle.
  • Cover the Discord manual gateway relaunch (P2) - The optional Discord roundtrip starts a second manual installed gateway but does not pass its holder or log path, so the new branch at this call boundary is bypassed and the same migration exit still waits until timeout. Forward those existing values and add a caller-level regression.
  • Resolve merge risk (P1) - Merging still leaves the optional Discord manual gateway relaunch unable to recover from the same intentional migration exit.
  • Resolve merge risk (P1) - The marker can be inspected before child-close drains final stderr, making the retry nondeterministically miss the refusal it is meant to recognize.
  • Complete next step (P2) - A protected maintainer-owned release-harness PR needs the two concrete corrections and an exact-head review before merge.
  • Improve patch quality - Await child close before reading the launch log.
  • Improve patch quality - Wire the Discord manual relaunch through the retry coordinator and cover it with a caller-level regression.
  • Improve patch quality - Rerun the affected release scenario on the repaired exact head.

Findings

  • [P2] Wait for child close before closing the launch log — scripts/lib/cross-os-release-checks/process.ts:145-147
  • [P2] Cover the Discord manual gateway relaunch — scripts/lib/cross-os-release-checks/installed.ts:617-640
Agent review details

Security

None.

PR surface

Tests +197, Other +120. Total +317 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 197 0 +197
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 5 141 21 +120
Total 6 338 21 +317

Review metrics

Metric Value Why it matters
Production versus test LOC production +141/-21 (net +120); tests +197/-0 The production growth is justified by a bounded shared restart capability and its two launch-owner integrations, but it warrants complete sibling-path coverage before merge.

Stored data model

Persistent data-model change detected: migration/backfill/repair: scripts/lib/cross-os-release-checks/process.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete the bounded recovery (recommended)
    Make log inspection wait for child close and pass the existing Discord holder and log path into the installed-gateway wait call, then recheck the exact head.
  2. Pause this release-harness change
    Do not merge until the owner confirms that leaving the Discord relaunch and stream-drain cases uncovered is acceptable.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Repair the child-close log-drain race and wire the Discord manual relaunch into the bounded retry; add caller-level regression coverage and rerun the focused release-check test.

Technical review

Best possible solution:

Await the child close/stdio-drain boundary before inspecting the launch log, and route every manual gateway relaunch—including Discord roundtrip—through the same bounded coordinator with caller-level regression coverage.

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

Yes, from source: current main deliberately emits the exact refusal at startup, while the affected manual readiness paths do not recover it; a focused release-harness run must still establish the full failing sequence.

Is this the best way to solve the issue?

No; the shared bounded coordinator is the right owner, but it must wait for final child output and cover the remaining manual relaunch caller to be the complete fix.

Full review comments:

  • [P2] Wait for child close before closing the launch log — scripts/lib/cross-os-release-checks/process.ts:145-147
    exitCode can be set before the child close boundary drains stdout/stderr, but this closes the file stream before reading the marker. The final refusal can therefore be omitted or written after end(), causing the bounded retry to miss the exact failure it is intended to handle.
    Confidence: 0.87
  • [P2] Cover the Discord manual gateway relaunch — scripts/lib/cross-os-release-checks/installed.ts:617-640
    The optional Discord roundtrip starts a second manual installed gateway but does not pass its holder or log path, so the new branch at this call boundary is bypassed and the same migration exit still waits until timeout. Forward those existing values and add a caller-level regression.
    Confidence: 0.93

Overall correctness: patch is incorrect
Overall confidence: 0.91

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 265f43eded8c.

Labels

Label changes:

  • add P2: The defect affects bounded cross-OS release validation rather than normal product runtime.
  • add merge-risk: 🚨 automation: The patch changes release-harness process recovery and can leave release lanes timing out or failing nondeterministically.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored release-harness PR is exempt from the external-contributor proof gate; the claimed release run remains useful evidence to rerun after the corrections.

Label justifications:

  • P2: The defect affects bounded cross-OS release validation rather than normal product runtime.
  • merge-risk: 🚨 automation: The patch changes release-harness process recovery and can leave release lanes timing out or failing nondeterministically.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🌊 off-meta tidepool and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This maintainer-authored release-harness PR is exempt from the external-contributor proof gate; the claimed release run remains useful evidence to rerun after the corrections.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Commit 4d9c249 introduced the current migration-refusal behavior and the related release-check surface; this PR is its immediate follow-up. (role: introduced current behavior and recent area contributor; confidence: high; commits: 4d9c249d4006; files: src/commands/doctor-config-preflight.ts, scripts/lib/cross-os-release-checks/installed.ts)

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.

@vincentkoc
vincentkoc force-pushed the fix/release-cross-os-migration-restart branch from ad6c11f to 8fe9bb3 Compare August 7, 2026 00:45
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc
vincentkoc marked this pull request as ready for review August 7, 2026 00:48
@vincentkoc
vincentkoc force-pushed the fix/release-cross-os-migration-restart branch from 8fe9bb3 to f86ea8a Compare August 7, 2026 00:53
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vincentkoc

Copy link
Copy Markdown
Member Author

Maintainer release-gate disposition:

  • Exact-head ClawSweeper review run 31136496521 reviewed f86ea8ad501c7ac4be1f1fc841627b04838c5fab: patch correct, no review findings, security cleared.
  • Its publisher failed only on the GitHub App installation rate limit in three attempts; the review shard itself completed successfully.
  • Rank-up move: attach redacted exact-head cross-OS output. This is intentionally deferred from the merge gate: run 31131961509 is the original candidate failure evidence, while the corrected full cross-OS/Parallels candidate matrix must run after this harness repair lands and before beta publication.
  • Current merge proof is 130/130 focused tests plus exact-head hosted CI green. No release publication is authorized by this merge.

@vincentkoc
vincentkoc merged commit 53006a2 into main Aug 7, 2026
103 checks passed
@vincentkoc
vincentkoc deleted the fix/release-cross-os-migration-restart branch August 7, 2026 01:25
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

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

Labels

maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: L status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant