Repository navigation
fix(release): let one publish parent dispatch finish - #157937
Conversation
Sweep a failed earlier parent's waiting children before every child dispatch (reject gate, cancel, bounded wait), retry transient gh reads, wait for the core package to be visible on the registry and run the beta-to-stable dist-tag sync through a release-ledger app token before verification, treat a run with a waiting gate as live in the tooling identity check, and verify an already-public GitHub release instead of failing to rewrite it.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
… read retries stay within its timeout
|
Codex review: needs real behavior proof before merge. Reviewed September 25, 2026, 2:28 AM ET / 06:28 UTC. ClawSweeper reviewWhat this changesThe branch adds GitHub read retries, stale publish-child cleanup, npm registry visibility and beta-tag synchronization, and idempotent GitHub release finalization, with supporting documentation and tests. Merge readiness⛔ Blocked before merge - 6 items remain Keep this PR open: its release recovery behavior is absent from current main and is distinct from the related orchestrator PR. One introduced child sweep can cancel a publication whose parent is still active, so the branch is not ready to merge. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s release publish parent receives an approved release target and dispatches npm and ClawHub child workflows. It then checks registry and child results before recording evidence and making the GitHub release public. flowchart LR
A[Approved release target] --> B[Publish parent]
B --> C[Child workflow inventory]
C --> D{Child parent state}
D --> E[Preserve active child]
D --> F[Reclaim failed parent's child]
B --> G[Registry and beta-tag checks]
G --> H[Release verification]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The new cross-repository token is scoped to the releases repository, but the child sweep can cross a live publication's gate and cancellation authority. PR surfaceTests +711, Docs +19, Config +46, Other +26. Total +802 across 13 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Give plugin npm children a verifiable parent run and attempt, reclaim them only after that parent is confirmed failed, and prove both allowed and live-sibling outcomes at the final GitHub cancellation boundary. Do we have a high-confidence way to reproduce the issue? No live current-main release dispatch was run in this read-only review. The reported failure paths are supported by the prior run descriptions and current-main source, while the introduced cross-parent cancellation path is clear from source. Is this the best way to solve the issue? Not yet. Bounded reads and registry visibility fit the existing publish owner, but the plugin npm sweep needs parent-bound authority before its cancellation path is safe. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d02f30910e91. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
… publish parent is live
|
Merged by admin after the gate lanes settled green on 60314a2 (70 pass, 0 fail) with the head-1 P1 fixed on this head (plugin npm children are reclaimed only while no other publish parent is live) and no ClawSweeper verdict posted for this head within the review window. Deferred from the head-1 ClawSweeper review (P2 / proof asks, not code defects on this head):
|
* fix(release): let one publish parent dispatch finish Sweep a failed earlier parent's waiting children before every child dispatch (reject gate, cancel, bounded wait), retry transient gh reads, wait for the core package to be visible on the registry and run the beta-to-stable dist-tag sync through a release-ledger app token before verification, treat a run with a waiting gate as live in the tooling identity check, and verify an already-public GitHub release instead of failing to rewrite it. * test(release): stub sleep in the Linux request dispatch fixture so gh read retries stay within its timeout * fix(release): reclaim waiting plugin npm children only while no other publish parent is live (cherry picked from commit 608db3b)
* fix(release): let one publish parent dispatch finish Sweep a failed earlier parent's waiting children before every child dispatch (reject gate, cancel, bounded wait), retry transient gh reads, wait for the core package to be visible on the registry and run the beta-to-stable dist-tag sync through a release-ledger app token before verification, treat a run with a waiting gate as live in the tooling identity check, and verify an already-public GitHub release instead of failing to rewrite it. * test(release): stub sleep in the Linux request dispatch fixture so gh read retries stay within its timeout * fix(release): reclaim waiting plugin npm children only while no other publish parent is live
What Problem This Solves
The 2026.9.6 stable needed 8 publish dispatches and a manual sweep between each because the parent died on failure classes it could have handled itself (evidence from 2026-09-23/24):
gh api ... /attempts/1/jobsGET returned HTTP 502 and killed the attempt.ClawHub dispatch blocked by waiting run; the parent cancelled the superseded child but gave up after 60 s while GitHub takes ~2 minutes to report awaitingrun cancelled.betadist-tags after core npm published; thesync_beta_to_stablefix lives inopenclaw/releasesand had to be run by hand between parents.+ [email protected]printed ~6 minutes before the registry document listed the version; the parent verified immediately.Finalize GitHub releasefailedrelease workflow run status does not match the authorized workflow identitybecause a sibling job waswaitingon thedocker-releasegate (run statuswaiting, notin_progress), after the operator had already flipped the release public.Summary
scripts/lib/release-publish-children.sh:gh_read: bounded retries (4, 5/10/20 s backoff) on transient failures (HTTP 5xx/429, rate limit, timeout, connection) for every read-onlyghcall in the parent; mutations, downloads and attestation never retry.sweep_superseded_childrenreplacescancel_superseded_clawhub_childand runs before every child dispatch (plugin-npm-release.yml,openclaw-npm-release.yml, both ClawHub publishers): rejects the pending gate, cancels, and waits (shared 5-minute budget) for a failed earlier parent's child of the same release. Correlation is byparent=<run>/<attempt>run title (core now carries arun-name); the owning parent is re-read and must be terminal (or an earlier attempt of this run). Plugin npm titles carry no parent tuple (Plugin NPM Release [<tag>] <sha>is matched exactly by the extended-stable tooling), so plugin npm children are reclaimed by release SHA + age only while no otheropenclaw-release-publish.ymlrun is live (any non-completed state, any tag): a waiting child whose parent is still active is therefore never touched; the sweep simply skips and leaves it to that parent. Live publishers, this attempt's own children, live/successful parents and legacy titles are preserved; unidentified same-ref ClawHub runs still block as before.cleanup_waiting_npm_childrenjoins the parent-failure cleanup step.wait_for_core_npm_visibility: polls the no-cache registry document (bounded 10 minutes) until the version and the target dist-tag are visible, before verification, on fresh and resumed publications.sync_npm_beta_floor: forlatestpublishes, dispatchesopenclaw/releasesopenclaw-npm-dist-tags.ymlmode=sync_beta_to_stablewith a release-ledger app token (GH App 2729701, installed org-wide withactions: write) and waits for it; missing token, dispatch failure or a failed run only warn and print the manual command, verification stays authoritative.wait_for_job_success/approve_child_publish_environment/approve_clawhub_bootstrap_environmentschain (no production callers).scripts/release-tooling-identity.mjs: a run with statuswaiting/queued/requested/pendingand no conclusion is live for theactivepolicies (parent and writer checks)..github/workflows/openclaw-release-publish.yml: release-ledger token step, visibility + sync beforeverify_published_release, npm-child cleanup on failure, andFinalize GitHub release(both anchored copies) verifies an already-public release with the expected prerelease/latest state and tag target instead of rewriting it.Docs:
docs/reference/RELEASING.md,.agents/skills/release-openclaw-ci/SKILL.md,.agents/skills/release-openclaw-maintainer/references/regular-release.md.Evidence
node scripts/run-vitest.mjs run --maxWorkers=2 test/scripts/release-publish-children.test.ts test/scripts/release-publish-parent.test.ts test/scripts/release-publish-finalize.test.ts test/scripts/release-tooling-identity.test.ts test/scripts/linux-app-channel.test.ts test/scripts/openclaw-npm-extended-stable-release.test.ts test/scripts/package-acceptance-workflow.test.ts: 7 files, 910 tests: 909 passed, 1 failed (package artifact reuse > lets reusable Docker E2E consume an already resolved package artifact, red onorigin/mainindependent of this branch: the assertion exists on main and main'sscripts/e2e/lib/upgrade-survivor/run.shlacks the expected string).pnpm check:changed: exit 0 (lanes testRoot, docs, tooling: format, line-cap, typecheck test root, knip dead-export scans, lint scripts, lint test root changed files).--maxWorkers=2, subprocess fixtures with stubbedsleep):release-publish-parent.test.ts28 tests 30.6 s,release-publish-finalize.test.ts9 tests 5.9 s,release-publish-children.test.ts9 tests 10.1 s (+3 retry cases); CI cost is ~47 s of one hosted small shard (checks-node-compact-small-3carried them green on this PR).test/scripts/release-publish-parent.test.ts(scripted fakegh/curlon PATH, stubbedsleep; sweep, cleanup, registry barrier, ledger sync, completion-step gating),test/scripts/release-publish-finalize.test.ts(finalize step extracted from the workflow YAML), retry cases inrelease-publish-children.test.ts, live-state tables inrelease-tooling-identity.test.ts.openclaw-barnacle) installation on theopenclaworg:repository_selection: all,permissions.actions: write(checked viaorgs/openclaw/installations).