Skip to content

fix(ci): retry transient npm advisory timeouts - #137716

Merged
vincentkoc merged 1 commit into
mainfrom
fix/pnpm-audit-shared-retry
Sep 4, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
fix/pnpm-audit-shared-retry

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Supersedes #137615

What Problem This Solves

Fixes an issue where pre-commit and release dependency audits could fail after a single transient timeout from npm's bulk advisory endpoint.

Why This Change Was Made

The shared advisory fetch boundary now retries exactly once only when its own tagged 60-second timeout fires, with a fresh request, abort controller, timer, and response lifecycle. HTTP failures, malformed or oversized responses, and unrelated errors still fail immediately.

This supersedes #137615 because that branch has maintainerCanModify=false and its proposed implementation is materially different: it raises the timeout and adds a pre-commit-only exported retry wrapper. This version keeps the existing limits and applies the retry at the shared boundary used by both pre-commit and release audits.

Credit to Dallin Romney (@RomneyDa) for identifying the transient advisory timeout and proposing retry behavior.

User Impact

Operators get one bounded recovery attempt for transient npm advisory timeouts without weakening fail-closed dependency checks or delaying other failures.

Evidence

  • Focused tooling tests recorded locally before the PR: 2 files, 70 tests passed.
  • Scoped node scripts/check-changed.mjs -- ... was also recorded passing locally before the PR.
  • Canceled Testbox run https://github.com/openclaw/openclaw/actions/runs/33822392273 is not proof and is intentionally excluded from the validation claim.
  • Exact-head CI run https://github.com/openclaw/openclaw/actions/runs/33822740506 attempt 2 completed green. In security-fast job 100871005983, the audit command ran from 00:52:37.003Z through successful output at 00:53:38.424Z (about 61.4 seconds), demonstrating one 60-second timeout followed by a successful fresh retry. openclaw/ci-gate job 100871425435 passed.
  • Independent unpatched security-fast job 100870692546 completed the audit command in about 17.5 seconds, confirming npm endpoint recovery. The earlier HTTP 503 failed closed; no unchanged manual retry was used as evidence.
  • git diff --check: passed.
  • Fresh Sol/high autoreview: scoped-clean, no actionable P0/P1 findings.
  • The shared advisory owner has a justified production delta of +13: the added lines own one bounded retry with fresh request, abort, timer, and response lifecycles for both audit callers.
  • Maintainer-label handling: this maintainer-authored repair was retained for normal maintainer review and landing.
  • Data-model and migration review is inapplicable: this script transport-control change does not alter persisted schema, configuration, or data format.
  • No changelog entry: this is internal CI and release-tooling resilience.

@vincentkoc vincentkoc self-assigned this Sep 4, 2026
@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M maintainer Maintainer-authored PR labels Sep 4, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 4, 2026 00:40
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Sep 4, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 8:52 PM ET / September 4, 2026, 00:52 UTC.

ClawSweeper review

What this changes

The PR retries a timed-out npm bulk-advisory request once with a fresh abort controller and timer, while preserving immediate failure for HTTP, malformed-response, and unrelated errors.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open. No blocking correctness or security finding was identified: the retry is placed at the shared npm bulk-advisory boundary used by both audit consumers, and current main still has the one-attempt behavior. The protected maintainer label requires explicit maintainer handling.

Priority: P2
Reviewed head: 0dfdab5d9860e34a18b26d035cb841f3393170a8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused shared-boundary repair with credible regression coverage and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored internal CI reliability repair; the supplied focused tests exercise the changed script boundary, while the external-contributor proof gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored internal CI reliability repair; the supplied focused tests exercise the changed script boundary, while the external-contributor proof gate does not apply.
Evidence reviewed 6 items Shared request owner: The introduced retry wraps only the npm bulk-advisory request owner; it preserves the request URL, POST payload, response bounds, and immediate propagation of non-timeout failures.
Both audit consumers use the owner: The pre-commit audit calls the shared fetch owner for each package chunk, and the release dependency-vulnerability gate imports and calls that same owner for its lockfile graphs.
Regression coverage: Focused tests cover a successful second attempt, two timed-out attempts, non-tagged timeout-like errors, HTTP failures, invalid JSON, empty bodies, oversized bodies, and the release-tool caller.
Findings None None.
Security None None.

How this fits together

The dependency-audit tooling sends resolved package versions to npm’s bulk advisory endpoint. Its results feed the pre-commit security gate and the release dependency-vulnerability gate, which fail closed on audit errors.

flowchart LR
  A[Dependency lockfiles] --> B[Dependency audit]
  B --> C[NPM bulk advisory request]
  C --> D{Tagged timeout?}
  D -->|first timeout| E[Fresh request lifecycle]
  D -->|other failure| F[Fail closed]
  E --> G[Advisory results]
  G --> H[Pre-commit and release gates]
Loading

Before merge

  • Resolve merge risk (P2) - Production tooling grows by 13 net lines. The growth is justified by needing a fresh request lifecycle per retry; moving retry policy into the shared timeout helper would also change the separate upstream-advisory requests that intentionally downgrade failures to partial coverage.
  • Complete next step (P2) - Complete explicit maintainer review for the protected maintainer label before merging.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Tests +140, Other +13. Total +153 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 191 51 +140
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 40 27 +13
Total 3 231 78 +153

Review metrics

Metric Value Why it matters
Production vs test delta production +40/-27 (net +13); tests +191/-51 (net +140) The small production increase implements fresh per-attempt lifecycle state; the larger test change exercises retry and no-retry error boundaries.

Stored data model

Persistent data-model change detected: serialized state: scripts/pre-commit/pnpm-audit-prod.mjs, unknown-data-model-change: scripts/pre-commit/pnpm-audit-prod.mjs. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the domain-local, exactly-once retry at the npm bulk-advisory owner; do not generalize retry policy into the timeout helper used by unrelated upstream-advisory requests.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the domain-local, exactly-once retry at the npm bulk-advisory owner; do not generalize retry policy into the timeout helper used by unrelated upstream-advisory requests.

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

Yes, source-reproducible: the focused tests induce an aborted five-millisecond request and verify recovery through both the direct owner and release-gate caller. This read-only review did not execute target tests.

Is this the best way to solve the issue?

Yes. The retry belongs at the shared npm bulk-advisory owner, so pre-commit and release auditing share one bounded policy without altering unrelated upstream-advisory behavior.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P2: This is a bounded reliability repair for CI and release security tooling, without evidence of an active user-runtime outage.
  • 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 is a maintainer-authored internal CI reliability repair; the supplied focused tests exercise the changed script boundary, while the external-contributor proof gate does not apply.

Label justifications:

  • P2: This is a bounded reliability repair for CI and release security tooling, without evidence of an active user-runtime outage.
  • 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 is a maintainer-authored internal CI reliability repair; the supplied focused tests exercise the changed script boundary, while the external-contributor proof gate does not apply.

Evidence

What I checked:

Likely related people:

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

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

Copy link
Copy Markdown
Member Author

Maintainer review complete for the three Before merge items:

  1. Merge risk accepted. Keep the exactly-once retry at the npm bulk-advisory owner. The +13 production-line delta is justified by the required fresh abort-controller, timer, response, and body lifecycle. Do not move this policy into the generic timeout helper because that would also change unrelated upstream-advisory requests.
  2. Protected maintainer review complete. I reviewed the shared owner, both callers, timeout tagging, no-retry error paths, focused tests, and the successful failed-job rerun: https://github.com/openclaw/openclaw/actions/runs/33822740506
  3. Data-model compatibility is not applicable. This changes transient HTTP retry control flow in scripts/pre-commit/pnpm-audit-prod.mjs; it does not change persisted state, serialized data, config, schemas, migrations, or upgrade behavior.

No Rank-up moves were present in the latest ClawSweeper review.

@vincentkoc
vincentkoc merged commit 3d30b3a into main Sep 4, 2026
283 of 285 checks passed
@vincentkoc
vincentkoc deleted the fix/pnpm-audit-shared-retry branch September 4, 2026 00:55
vincentkoc added a commit that referenced this pull request Sep 4, 2026
…date-command

* origin/main:
  fix(ci): retry transient npm advisory timeouts (#137716)
  fix: keep restored Usage navigation from being replaced by Chat (#137402)
  fix: keep Usage day totals within the selected session scope (#137396)
  refactor: reduce live digest scheduling allocations (#137655)
  fix(ui): submit selected slash arguments in new sessions (#137571)
  fix(ui): expand collapsed task progress on final (#137569)
  fix(test): prevent auth discovery from stalling MCP replacement proof (#137639)
  test(cli): reuse canonical directory mock call helper (#137640)
roboclaw-bot pushed a commit that referenced this pull request Sep 4, 2026
Patrick-Erichsen added a commit that referenced this pull request Sep 4, 2026
* fix(cron): allow pinned widget updates

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 6f3f9c02-ebb9-494d-bf74-e0f2cd28cff7

* fix(cron): keep widget prompt within compact budget

Worked on by:

- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: b5e9377a-9f92-4e2e-8a88-9ed60172f26e

* ci: refresh checks against current main

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 22166308-a697-45ab-84ca-a425f1513dd8

* fix(ci): retry transient npm advisory timeouts (#137716)

Co-authored-by: Dallin Romney <[email protected]>

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 3b52db99-2781-4524-a579-4878b5923a17

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 5505caac-c55a-419b-aff2-7b02575bb186

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 4, 2026
…37666)

* fix(cron): allow pinned widget updates

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 6f3f9c02-ebb9-494d-bf74-e0f2cd28cff7

* fix(cron): keep widget prompt within compact budget

Worked on by:

- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: b5e9377a-9f92-4e2e-8a88-9ed60172f26e

* ci: refresh checks against current main

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 22166308-a697-45ab-84ca-a425f1513dd8

* fix(ci): retry transient npm advisory timeouts (openclaw#137716)

Co-authored-by: Dallin Romney <[email protected]>

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 3b52db99-2781-4524-a579-4878b5923a17

* fix(cron): let session automations refresh pinned widgets

Worked on by:
- @Patrick-Erichsen

Co-authored-by: Patrick-Erichsen <[email protected]>
OpenClaw-Publication: 5505caac-c55a-419b-aff2-7b02575bb186

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Patrick-Erichsen <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: Dallin Romney <[email protected]>
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: M 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