Skip to content

fix(release): retry plugin lock generation - #117668

Merged
vincentkoc merged 1 commit into
mainfrom
fix/plugin-lock-generation-retry
Aug 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/plugin-lock-generation-retry

Conversation

@vincentkoc

Copy link
Copy Markdown
Member

What Problem This Solves

Resolves a release publication failure where plugins with bundled dependencies could spend ten minutes generating package-lock.json, then abort the entire plugin npm release on a transient registry timeout.

Why This Change Was Made

Plugin package-lock generation now uses the same bounded retry policy as the subsequent package-local install: three 180-second attempts, retrying only ETIMEDOUT. The timeout is threaded into the existing lock generator without changing frozen release package inputs.

User Impact

Release operators can complete all-publishable plugin npm releases despite transient npm registry stalls. Ordinary dependency and lock validation failures still fail immediately.

Evidence

  • node scripts/run-vitest.mjs test/plugin-npm-package-manifest.test.ts test/scripts/generate-npm-package-lock.test.ts - 49 tests passed.
  • node scripts/check-script-declarations.mjs - 249 declaration contracts match.
  • git diff --check - passed.
  • The broader local script/test type lanes remain blocked by pre-existing main errors in packages/terminal-core/src/ansi.ts and missing sparse UI/QA/Android artifacts; hosted exact-head CI is required.
  • Live failure evidence: plugin npm run 30720863740 timed out during npm install --package-lock-only before reaching the already-retried npm ci phase.

AI-assisted: yes.

@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@vincentkoc vincentkoc self-assigned this Aug 1, 2026
@clawsweeper

clawsweeper Bot commented Aug 1, 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:

@vincentkoc
vincentkoc marked this pull request as ready for review August 1, 2026 22:34
@vincentkoc
vincentkoc requested a review from a team as a code owner August 1, 2026 22:34
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: S maintainer Maintainer-authored PR labels Aug 1, 2026
@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. P2 Normal backlog priority with limited blast radius. 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, 6:38 PM ET / 22:38 UTC.

ClawSweeper review

What this changes

The PR retries transient ETIMEDOUT failures while generating a plugin package lock during npm release staging, using a three-attempt 180-second policy already used for package-local dependency installation.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

This PR is still necessary: current main generates the package lock with a direct npm subprocess call and has no retry around that phase. The proposed retry follows the existing bounded retry policy for the subsequent bundled-dependency install, preserves immediate failures for non-timeout errors, and has focused coverage. It is maintainer-authored and carries the maintainer label, so it should remain open for normal exact-head CI and maintainer review. Likely related people: Vincent Koc (high confidence) and Peter Steinberger (medium confidence).

Priority: P2
Reviewed head: 36bddd85f165e555560499f368c8a074d9fef749

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) This is a focused, well-scoped reliability repair with matching declaration and test coverage; it awaits ordinary hosted validation rather than code changes.
Proof confidence 🌊 off-meta tidepool Not applicable: This MEMBER-authored release-script PR is outside the external-contributor proof gate; the supplied report identifies the before-fix timeout and the focused tests cover the retry boundary.
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 outside the external-contributor proof gate; the supplied report identifies the before-fix timeout and the focused tests cover the retry boundary.
Evidence reviewed 5 items Current-main gap: Current main calls generateNpmPackageLock directly while staging bundled plugin dependencies, so a timeout in lock generation still aborts before the existing retry wrapper for npm ci is reached.
Retry reaches the actual subprocess timeout: The branch threads its generated environment through the npm-command resolver and execution options, which read OPENCLAW_NPM_LOCK_COMMAND_TIMEOUT_MS; this makes the wrapper’s 180-second limit apply to the lock-generation npm process.
Narrow failure policy: The new helper retries only errors with code ETIMEDOUT; it rethrows all other generator errors and is used only for the bundled-dependency package-lock generation call.
Findings None None.
Security None None.

How this fits together

The plugin release packager temporarily stages a plugin’s npm manifest, generates its package-lock.json, installs bundled runtime dependencies, and then publishes the package. This change makes a transient registry stall during the lock-generation step retryable without relaxing validation failures in the release flow.

flowchart LR
  A[Plugin release package] --> B[Stage package metadata]
  B --> C[Generate npm package lock]
  C --> D{Registry timeout?}
  D -- no --> E[Install bundled dependencies]
  D -- retry budget remains --> C
  D -- other error or exhausted --> F[Fail plugin publish]
  E --> G[Publishable plugin package]
Loading

Before merge

  • Complete next step (P2) - The code review is clean, but this MEMBER-authored PR has the protected maintainer label and should proceed through normal exact-head CI and maintainer review rather than an automated repair or cleanup lane.
Agent review details

Security

None.

PR surface

Tests +48, Other +42. Total +90 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 48 0 +48
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 50 8 +42
Total 5 98 8 +90

Review metrics

None.

Technical review

Best possible solution:

Retain the bounded timeout retry at the package-lock generation boundary, keep non-timeout validation failures terminal, and land it after the exact-head hosted checks complete.

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

Yes. Current main directly invokes npm while generating the lock at scripts/generate-npm-package-lock.mjs:832, and a timeout there reaches no retry until this PR’s wrapper is applied.

Is this the best way to solve the issue?

Yes. The patch repairs the failing subprocess boundary with the repository’s existing bounded retry policy rather than broadening retries or masking ordinary dependency validation errors.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: The patch addresses a bounded release-pipeline reliability failure without changing ordinary agent or channel runtime behavior.
  • 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 outside the external-contributor proof gate; the supplied report identifies the before-fix timeout and the focused tests cover the retry boundary.

Label justifications:

  • P2: The patch addresses a bounded release-pipeline reliability failure without changing ordinary agent or channel runtime behavior.
  • 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 outside the external-contributor proof gate; the supplied report identifies the before-fix timeout and the focused tests cover the retry boundary.

Evidence

What I checked:

Likely related people:

  • vincentkoc: Authored the current PR and the prior merged release-script change that established bounded retries for bundled dependency installation. (role: recent area contributor; confidence: high; commits: deffca656500, 36bddd85f165; files: scripts/lib/plugin-npm-package-manifest.mjs, test/plugin-npm-package-manifest.test.ts)
  • Peter Steinberger: Recent history and blame identify Peter Steinberger as a frequent contributor to the lock-generator and release-helper area. (role: recent adjacent contributor; confidence: medium; commits: a26df7153f81; files: scripts/generate-npm-package-lock.mjs, scripts/lib/plugin-npm-package-manifest.mjs)

Rank-up moves

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

  • Allow the exact-head hosted checks to finish before merge.

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 merged commit eb8c22e into main Aug 1, 2026
145 of 155 checks passed
@vincentkoc
vincentkoc deleted the fix/plugin-lock-generation-retry branch August 1, 2026 22:49
@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 P2 Normal backlog priority with limited blast radius. 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