Skip to content

fix(release): recover plugin packaging from registry stalls - #117618

Merged
vincentkoc merged 1 commit into
mainfrom
fix/plugin-pack-install-timeout
Aug 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/plugin-pack-install-timeout

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves a release blocker where publishing a plugin with bundled runtime dependencies can hang on a transient npm registry fetch until the package preview fails. The 2026.7.2-beta.7 WhatsApp preview reproduced the same ten-minute spawnSync ... ETIMEDOUT failure on three fresh hosted runners.

Why This Change Was Made

Package-local npm ci now has a three-minute bound and retries only process timeouts. A timed-out attempt removes its partial node_modules tree before retrying the same generated lock; ordinary install failures still fail immediately.

User Impact

Plugin and OpenClaw releases can recover automatically from transient npm registry stalls instead of requiring repeated full publication attempts.

Evidence

@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 1, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review August 1, 2026 20:20
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 4:35 PM ET / 20:35 UTC.

ClawSweeper review

What this changes

The PR adds a bounded three-attempt retry for package-local npm ci during bundled plugin packaging, deleting partial node_modules after every timeout while leaving ordinary install failures fail-fast.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

No blocking correctness finding remains: the current head fixes the prior terminal-timeout cleanup gap and preserves fail-fast handling for ordinary npm failures. This member-authored, maintainer-labeled release change should remain open for release-owner approval of the three-minute retry policy and the resumed beta packaging evidence; likely related people are Peter Steinberger and vincentkoc.

Priority: P1
Reviewed head: 1d28388297c77cb45ce0ebef09902cb574b603f7
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused implementation resolves the prior cleanup defect and has targeted regression coverage, with release-owner confirmation of the timeout policy still needed.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored release-script PR is not subject to the external-contributor proof gate; the pending beta packaging output remains important release evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored release-script PR is not subject to the external-contributor proof gate; the pending beta packaging output remains important release evidence.
Evidence reviewed 7 items Current-main failure path: Current main calls the package-local npm installer once and throws any returned process error; it has no timeout-specific cleanup or retry path, so the reported recovery behavior is not already implemented on main.
Resolved prior cleanup finding: The PR cleans node_modules immediately after every ETIMEDOUT, including the exhausted final attempt, before returning the error to the existing caller; this closes the prior review finding about same-directory reuse.
Staging lifecycle owner: The package wrapper only receives its normal cleanup closure after installation succeeds, so timeout cleanup must occur inside the installation attempt rather than relying on the outer success-path cleanup.
Findings None None.
Security None None.

How this fits together

Plugin release packaging temporarily prepares a publishable plugin directory and runs package-local npm installation for bundled runtime dependencies. That staging directory then feeds the package preview and publication commands, so incomplete dependency output can block later release attempts.

flowchart LR
  A[Plugin package input] --> B[Temporary package staging]
  B --> C[Package-local npm install]
  C --> D{Install timed out?}
  D -->|No| E[Return result to packaging]
  D -->|Yes| F[Remove partial dependencies]
  F --> G[Retry up to three attempts]
  G --> C
  E --> H[Preview or publish plugin]
Loading

Decision needed

Question Recommendation
Should plugin release packaging adopt a three-minute cap per package-local npm install attempt, accepting that a persistently slow but valid registry can now fail after three cleaned attempts? Approve the bounded retry policy: Accept the three-attempt, three-minute cap after the resumed beta packaging child confirms the affected release path completes or fails cleanly without residual staging state.

Why: The source proves the retry and cleanup mechanics, but no code inspection can determine the acceptable latency budget for production release runners and registries.

Before merge

  • Resolve merge risk (P1) - A legitimate but consistently slow registry may now hit the three-minute cap on all three attempts and fail where an unbounded install could eventually succeed; that release-policy tradeoff needs owner confirmation.
  • Resolve merge risk (P1) - The PR body says the resumed beta plugin-publish child will supply after-fix release-path evidence, but that artifact is not yet present in the supplied review context.
  • Complete next step (P2) - A member-authored, maintainer-labeled release change needs release-owner approval of the bounded timeout policy and the pending beta-path evidence rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Tests +94, Other +40. Total +134 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 95 1 +94
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 41 1 +40
Total 3 136 2 +134

Review metrics

Metric Value Why it matters
Package install recovery policy 1 new 180-second cap; up to 3 attempts This changes the maximum tolerated duration and retry behavior of every bundled-plugin package-local dependency install.

Merge-risk options

Maintainer options:

  1. Confirm bounded retry on the beta release path (recommended)
    Before merge, use the resumed beta plugin-publish child to confirm that retry cleanup leaves the staging directory clean and that normal packaging succeeds under the selected cap.
  2. Accept slow-registry failure risk
    Merge the three-minute cap as an intentional release reliability policy even if some slow but healthy registries may exhaust all retries.
  3. Pause for release-runner evidence
    Hold this PR if beta output cannot establish that the new cap is suitable for the supported release environment.

Technical review

Best possible solution:

Keep the single installer path, retain cleanup on every timeout, and merge only after the release owner accepts the three-minute-per-attempt policy and the resumed beta child demonstrates clean package staging through the affected path.

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

No live current-main reproduction was run in this read-only review; the supplied context links the hosted-runner timeout and current source confirms that main lacks any timeout recovery path.

Is this the best way to solve the issue?

Yes, the cleanup belongs inside the package-local installation owner because the outer packaging cleanup is installed only after a successful install; the remaining question is whether the chosen production timeout budget is the right release policy.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored release-script PR is not subject to the external-contributor proof gate; the pending beta packaging output remains important release evidence.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review merge-risk labels are merge-risk: 🚨 availability.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The reported registry stall blocks plugin packaging and can block a release run.
  • merge-risk: 🚨 availability: A fixed three-minute installation cap can cause release packaging to fail in slow but otherwise valid registry conditions.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored release-script PR is not subject to the external-contributor proof gate; the pending beta packaging output remains important release evidence.

Evidence

What I checked:

  • Current-main failure path: Current main calls the package-local npm installer once and throws any returned process error; it has no timeout-specific cleanup or retry path, so the reported recovery behavior is not already implemented on main. (scripts/lib/plugin-npm-package-manifest.mjs:436, fb3d473a73b0)
  • Resolved prior cleanup finding: The PR cleans node_modules immediately after every ETIMEDOUT, including the exhausted final attempt, before returning the error to the existing caller; this closes the prior review finding about same-directory reuse. (scripts/lib/plugin-npm-package-manifest.mjs:250, 1d28388297c7)
  • Staging lifecycle owner: The package wrapper only receives its normal cleanup closure after installation succeeds, so timeout cleanup must occur inside the installation attempt rather than relying on the outer success-path cleanup. (scripts/lib/plugin-npm-package-manifest.mjs:733, fb3d473a73b0)
  • Regression coverage: The PR adds focused coverage for retry-after-timeout, immediate failure for non-timeout npm results, and an exhausted-timeout run followed by reuse of the same staging directory. (test/plugin-npm-package-manifest.test.ts:189, 1d28388297c7)
  • Node process contract: The locally inspected Node child-process declarations define timeout for synchronous spawn results and state that, after timeout and kill, spawnSync waits until the child has exited; deleting staging output after the call is therefore aligned with the runtime contract.
  • Feature history: Blame attributes the existing package-local staging and clean-directory guard to the current main packaging boundary, while the retry helper and its caller integration are attributed to the PR head. (scripts/lib/plugin-npm-package-manifest.mjs:422, 1d28388297c7)

Likely related people:

  • Peter Steinberger: Current-main blame attributes the package-local bundled-dependency staging and its clean-directory invariant to this area of the release script. (role: current packaging-boundary contributor; confidence: high; commits: 142ad75c4336; files: scripts/lib/plugin-npm-package-manifest.mjs)
  • vincentkoc: Authored the current retry and cleanup implementation, and file history shows repeated contributions across the release manifest script and its focused tests. (role: recent release-script contributor; confidence: high; commits: 1d28388297c7; files: scripts/lib/plugin-npm-package-manifest.mjs, test/plugin-npm-package-manifest.test.ts)

Rank-up moves

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

  • Attach or link redacted resumed-beta output proving package-local staging is clean after the affected release path.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-01T20:26:18.994Z sha 9e8d0350b8337d04c3f141978f09ad6b2c712486 :: needs changes before merge. :: [P2] Clean up the final timed-out staging attempt

@vincentkoc
vincentkoc force-pushed the fix/plugin-pack-install-timeout branch from 9e8d035 to 1d28388 Compare August 1, 2026 20:30
@vincentkoc

Copy link
Copy Markdown
Member Author

Resolved the latest ClawSweeper findings on head 1d28388297c77cb45ce0ebef09902cb574b603f7:

  • cleanup now runs after every ETIMEDOUT, including the exhausted final attempt;
  • the new regression exhausts all three attempts, reuses the same plugin directory, and proves the next package attempt starts without partial node_modules;
  • ordinary non-timeout npm failures still return immediately without retry cleanup.

The 180-second per-attempt bound is retained. The release incident stalled for roughly ten minutes on each hosted attempt, while a fresh install of the exact generated lock completed in seconds. The resumed beta plugin-publish child will provide the after-fix release-path evidence.

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 1, 2026
@vincentkoc

Copy link
Copy Markdown
Member Author

Release-owner decision: approved.

For this beta, accept the bounded policy of three attempts with a 180-second timeout per package-local npm install. The incident showed three hosted attempts hanging for roughly ten minutes each, while the exact generated lock installed normally from a fresh cache. The corrected implementation cleans partial staging after every timeout, including terminal exhaustion, so retry and later release attempts remain deterministic.

The resumed beta publish child will be linked here as the release-path evidence after this infrastructure fix lands.

@vincentkoc
vincentkoc merged commit deffca6 into main Aug 1, 2026
108 of 116 checks passed
@vincentkoc
vincentkoc deleted the fix/plugin-pack-install-timeout branch August 1, 2026 21:10
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

@vincentkoc

Copy link
Copy Markdown
Member Author

Resumed beta publication is now running against the merged recovery:

The child is packaging the frozen v2026.7.2-beta.7 release evidence with the bounded timeout retry now on main. I will post the terminal publication result here as the after-fix release proof.

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: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant