Skip to content

fix(release): let one publish parent dispatch finish - #157937

Merged
steipete merged 3 commits into
mainfrom
release-speed/publish-parent
Sep 25, 2026
Merged

steipete merged 3 commits into
mainfrom
release-speed/publish-parent

Conversation

@steipete

@steipete steipete commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

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):

  • run 35918097494: one gh api ... /attempts/1/jobs GET returned HTTP 502 and killed the attempt.
  • runs 35924277914 / 35929160976: 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 a waiting run cancelled.
  • run 35929857680: completion verify failed on ~90 stale plugin beta dist-tags after core npm published; the sync_beta_to_stable fix lives in openclaw/releases and had to be run by hand between parents.
  • core child 35930626357: + [email protected] printed ~6 minutes before the registry document listed the version; the parent verified immediately.
  • job 107434265246 (run 35933709927): Finalize GitHub release failed release workflow run status does not match the authorized workflow identity because a sibling job was waiting on the docker-release gate (run status waiting, not in_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-only gh call in the parent; mutations, downloads and attestation never retry.
  • sweep_superseded_children replaces cancel_superseded_clawhub_child and 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 by parent=<run>/<attempt> run title (core now carries a run-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 other openclaw-release-publish.yml run 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_children joins 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: for latest publishes, dispatches openclaw/releases openclaw-npm-dist-tags.yml mode=sync_beta_to_stable with a release-ledger app token (GH App 2729701, installed org-wide with actions: write) and waits for it; missing token, dispatch failure or a failed run only warn and print the manual command, verification stays authoritative.
  • Removed the unused wait_for_job_success / approve_child_publish_environment / approve_clawhub_bootstrap_environments chain (no production callers).

scripts/release-tooling-identity.mjs: a run with status waiting/queued/requested/pending and no conclusion is live for the active policies (parent and writer checks).

.github/workflows/openclaw-release-publish.yml: release-ledger token step, visibility + sync before verify_published_release, npm-child cleanup on failure, and Finalize 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 on origin/main independent of this branch: the assertion exists on main and main's scripts/e2e/lib/upgrade-survivor/run.sh lacks 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).
  • Per-file wall time (local, --maxWorkers=2, subprocess fixtures with stubbed sleep): release-publish-parent.test.ts 28 tests 30.6 s, release-publish-finalize.test.ts 9 tests 5.9 s, release-publish-children.test.ts 9 tests 10.1 s (+3 retry cases); CI cost is ~47 s of one hosted small shard (checks-node-compact-small-3 carried them green on this PR).
  • New tests: test/scripts/release-publish-parent.test.ts (scripted fake gh/curl on PATH, stubbed sleep; 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 in release-publish-children.test.ts, live-state tables in release-tooling-identity.test.ts.
  • GH App 2729701 (openclaw-barnacle) installation on the openclaw org: repository_selection: all, permissions.actions: write (checked via orgs/openclaw/installations).

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.
@clawsweeper

clawsweeper Bot commented Sep 25, 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.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XL labels Sep 25, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 25, 2026, 2:28 AM ET / 06:28 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: 79f49102d0f2ec12044d22c98f3bf2c7c7301a5f

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The branch has substantial focused validation, but a reachable cancellation defect and mock-only authority proof prevent merge readiness.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: Authority-chain proof required: the changed publish helper reaches GitHub gate rejection and run cancellation, but the supplied tests substitute fake gh and curl clients and show no final-effect trace protecting a waiting child owned by a still-active sibling parent. Add redacted production-boundary evidence for both that forbidden case and an authorized failed-parent recovery; remove tokens, private endpoints, and other private details before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) Security review found an item that needs attention.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: Authority-chain proof required: the changed publish helper reaches GitHub gate rejection and run cancellation, but the supplied tests substitute fake gh and curl clients and show no final-effect trace protecting a waiting child owned by a still-active sibling parent. Add redacted production-boundary evidence for both that forbidden case and an authorized failed-parent recovery; remove tokens, private endpoints, and other private details before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 10 items Introduced cancellation trigger: The plugin npm sweep selects older runs using the shared title, target SHA, and age, then rejects deployment gates and cancels the run without checking its owning parent's state.
Concurrent parent and shared child identity: Current main groups publish parents by npm dist-tag. The plugin npm workflow names dispatches by its own dist-tag and source SHA; the parent passes the same default plugin dist-tag for beta and latest publishes, so two active parents can have indistinguishable plugin-child titles.
Plugin child title contract: The existing plugin npm run name does not contain the publish parent run or attempt.
Findings 1 actionable finding [P1] Bind plugin npm cancellation to its failed parent
Security Needs attention A live sibling's publication gate can be rejected: Plugin npm selection lacks a verified parent tuple, so a later publish parent can reject and cancel an older waiting child even when its owning parent remains active.

How this fits together

OpenClaw’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]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: Authority-chain proof required: the changed publish helper reaches GitHub gate rejection and run cancellation, but the supplied tests substitute fake gh and curl clients and show no final-effect trace protecting a waiting child owned by a still-active sibling parent. Add redacted production-boundary evidence for both that forbidden case and an authorized failed-parent recovery; remove tokens, private endpoints, and other private details before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Bind plugin npm cancellation to its failed parent (P1) - Beta and latest publish parents have separate concurrency groups, yet their plugin npm children can share the same default-tag title and source SHA. If the earlier parent's child is waiting at a gate while that parent remains active, this SHA-and-age match rejects its gate and cancels it without the failed-parent check used for other children. Include parent run/attempt identity and verify that parent is terminal before these side effects.
  • Resolve security concern: A live sibling's publication gate can be rejected - Plugin npm selection lacks a verified parent tuple, so a later publish parent can reject and cancel an older waiting child even when its owning parent remains active.
  • Resolve merge risk (P1) - The new cancellation path has no production-boundary final-effect evidence that a still-active sibling parent keeps its waiting plugin child and gate.
  • Resolve merge risk (P1) - The two added subprocess test suites lack the per-file wall and CI cost measurements required by repository policy.
  • Complete next step (P2) - Repair plugin npm parent correlation, provide redacted allowed-and-forbidden final-effect proof, and add the required new-test cost measurements to the PR body; updating the body should trigger re-review, or a maintainer can request @clawsweeper re-review.

Findings

  • [P1] Bind plugin npm cancellation to its failed parent — scripts/lib/release-publish-children.sh:178-181
  • [medium] A live sibling's publication gate can be rejected — scripts/lib/release-publish-children.sh:178
Agent review details

Security

Needs 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 surface

Tests +711, Docs +19, Config +46, Other +26. Total +802 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 6 717 6 +711
Docs 3 48 29 +19
Config 2 55 9 +46
Generated 0 0 0 0
Other 2 238 212 +26
Total 13 1058 256 +802

Review metrics

Metric Value Why it matters
Production versus test growth production/tooling +72 net lines, tests +711 net lines The production growth serves the release recovery flow; the added subprocess coverage needs its required cost measurement.
Cross-repository credential 1 app token added The release parent now receives an Actions-write token scoped to the releases repository for beta-tag synchronization.

Merge-risk options

Maintainer options:

  1. Bind cancellation to the failed parent (recommended)
    Carry plugin-child parent identity through the workflow and verify the parent's current run state before gate rejection or cancellation, then add final-effect proof for a failed parent and a live sibling parent.

Technical review

Best 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:

  • [P1] Bind plugin npm cancellation to its failed parent — scripts/lib/release-publish-children.sh:178-181
    Beta and latest publish parents have separate concurrency groups, yet their plugin npm children can share the same default-tag title and source SHA. If the earlier parent's child is waiting at a gate while that parent remains active, this SHA-and-age match rejects its gate and cancels it without the failed-parent check used for other children. Include parent run/attempt identity and verify that parent is terminal before these side effects.
    Confidence: 0.92

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded release automation repair with meaningful operator impact and an introduced cross-parent cancellation defect.
  • add merge-risk: 🚨 security-boundary: The sweep can use one publish parent's write authority to reject the gate and cancel a child owned by another live parent.
  • add merge-risk: 🚨 automation: Merging the new sweep can cancel another active publication and fail its release workflow.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the changed publish helper reaches GitHub gate rejection and run cancellation, but the supplied tests substitute fake gh and curl clients and show no final-effect trace protecting a waiting child owned by a still-active sibling parent. Add redacted production-boundary evidence for both that forbidden case and an authorized failed-parent recovery; remove tokens, private endpoints, and other private details before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded release automation repair with meaningful operator impact and an introduced cross-parent cancellation defect.
  • merge-risk: 🚨 automation: Merging the new sweep can cancel another active publication and fail its release workflow.
  • merge-risk: 🚨 security-boundary: The sweep can use one publish parent's write authority to reject the gate and cancel a child owned by another live parent.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Authority-chain proof required: the changed publish helper reaches GitHub gate rejection and run cancellation, but the supplied tests substitute fake gh and curl clients and show no final-effect trace protecting a waiting child owned by a still-active sibling parent. Add redacted production-boundary evidence for both that forbidden case and an authorized failed-parent recovery; remove tokens, private endpoints, and other private details before posting. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Security concerns:

  • [medium] A live sibling's publication gate can be rejected — scripts/lib/release-publish-children.sh:178
    Plugin npm selection lacks a verified parent tuple, so a later publish parent can reject and cancel an older waiting child even when its owning parent remains active.
    Confidence: 0.92

What I checked:

  • Introduced cancellation trigger: The plugin npm sweep selects older runs using the shared title, target SHA, and age, then rejects deployment gates and cancels the run without checking its owning parent's state. (scripts/lib/release-publish-children.sh:178, 79f49102d0f2)
  • Concurrent parent and shared child identity: Current main groups publish parents by npm dist-tag. The plugin npm workflow names dispatches by its own dist-tag and source SHA; the parent passes the same default plugin dist-tag for beta and latest publishes, so two active parents can have indistinguishable plugin-child titles. (.github/workflows/openclaw-release-publish.yml:132, d02f30910e91)
  • Plugin child title contract: The existing plugin npm run name does not contain the publish parent run or attempt. (.github/workflows/plugin-npm-release.yml:2, d02f30910e91)
  • Existing test coverage: The new fake-GitHub test expects an older same-SHA plugin run to be cancelled; it does not model that run's still-active parent. (test/scripts/release-publish-parent.test.ts:277, 79f49102d0f2)
  • Current-main need: Current main still has the earlier ClawHub-only reclaim path and lacks the branch's generalized child sweep, registry barrier, and beta-floor helper. The proposed change remains useful. (scripts/lib/release-publish-children.sh:99, d02f30910e91)
  • Release owner history: The current-main release publisher and child helper were substantially changed by the earlier merged release redesign; later release validation fixes also touched this surface. Source-line introduction could not be verified because historical blame attempted to fetch an unavailable promisor object. (scripts/lib/release-publish-children.sh, ebdab59f91db)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Bind plugin npm children to their owning parent and add final-effect proof that a live sibling parent cannot have its child gate rejected or run cancelled.
  • Report per-file wall time and CI seconds for the two new subprocess test suites.

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.

@steipete
steipete merged commit 608db3b into main Sep 25, 2026
109 of 111 checks passed
@steipete
steipete deleted the release-speed/publish-parent branch September 25, 2026 07:00
@steipete

Copy link
Copy Markdown
Contributor Author

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):

  • Production-boundary final-effect proof of the sweep (a failed-parent child reclaimed; a live sibling parent's child left untouched). This needs a real publish parent dispatch; it will be captured on the next stable publish run and linked from docs/reference/RELEASING.md's publish-children section.
  • The per-file wall times and CI cost for the two new subprocess suites are in the PR body (Evidence).

steipete added a commit that referenced this pull request Sep 25, 2026
* 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)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 26, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant