Skip to content

fix(packaging): preserve required SDK API installation - #182168

Merged
steipete merged 1 commit into
mainfrom
codex/nodew-r11-package-peer
Oct 24, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/nodew-r11-package-peer

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A fresh npm install can report success while leaving node_modules/@opentelemetry/api empty. The Anthropic SDK requires that package, so the installed Gateway then fails to start. This also blocked direct update acceptance after an otherwise successful 2026.9.33 update and Doctor migration.

User Impact

The privately bundled AI runtime no longer advertises the redundant API peer that triggers npm's missing extraction. Installed-package verification rejects an unresolved API dependency when the installed SDK requires it.

Why This Change Was Made

The package owner already removes dependency declarations from the private AI copy because the root owns its runtime dependencies. Remove only @opentelemetry/api from that copy's peerDependencies and peerDependenciesMeta too. Keep unrelated peers, the standalone AI manifest, all dependency versions, overrides, and the npm lock mirror unchanged.

Peter approved this exact package-side metadata change on 2026-10-23. It addresses npm behavior reproduced on 11.19.1, with additional coordinator-confirmed reproductions on 11.21.1 and 12.2.1; upgrading npm does not avoid the defect.

Evidence

  • Three serial clean-prefix probes on Node 24.22.1 / npm 11.19.1 used the same SDK 0.135.0 and selected API 1.10.0. Optional and required bundled-peer variants both exited 0 but left an empty API directory and failed the SDK tracing import. Removing the bundled API peer installed the API files and made the import pass.
  • Both regressions fail on the baseline for the intended reason: the private artifact retains the API peer, and installed-tree verification accepts the empty required dependency.
  • Both regressions pass after the fix. The complete installed-tree test file passes all 12 cases (3.29 s wall). The combined focused package/installed-tree run took 16.24 s wall; the package case used 11.98 s, predominantly transformation. No timers, retries, limits, or versions changed.
  • Changed-file format/lint and independent review passed. The exact-head package build and tarball integrity check passed.
  • A clean-prefix npm install of the candidate passed in 17.17 s and populated API 1.10.0 with its manifest and exports. The installed-tree check confirmed that required API resolution succeeds, but rejected the package for 49,094 entries against the 47,500-entry budget. Its 571.7 MiB size is below the 900 MiB byte budget; the shipped updater cap is 50,000 entries. No budget was changed.
  • Fresh current-main baseline a6d0da2955aa91ce0bd59457383a8bc6c95d6079 also fails the same unmodified checker: 48,634 entries (1,134 over), 598,943,400 bytes. The fixed candidate has 49,094 entries, 599,490,866 bytes. The API subtree changes from an empty root (1 entry) to 460 entries including its root: 459 restored files/directories. Whole-tree delta is 460 entries. Both trees remain below the 50,000-entry shipped-updater cap; the fixed candidate has 906 entries of headroom.
  • The entry-budget failure is inherited and remains recorded as failed; no budget or assertion was relaxed. The coordinator authorized landing with this baseline evidence. SDK tracing import, isolated Gateway /readyz (HTTP 200, ready=true), and CLI health (ok=true) all pass on the fresh installed candidate; orderly Gateway shutdown exits 0. The full combined upgrade/rollback matrix belongs to fix(update): restore direct updates from extended-stable 2026.9.33 #182129.

Production Size

+24 lines in packaging and verification scripts, +30 net test lines, +4 documentation lines; 5 files. Runtime production files under src, extensions, packages, and ui: 0 changed lines. The script growth stays within the approved +30 production/config budget: five lines remove the private peer metadata, and nineteen add required-dependency resolution to the existing installed-tree walk.

Drop the API peer only from the private bundled AI manifest to avoid npm returning an empty required dependency. Verify SDK API resolution during installed-package checks. Dependency versions, overrides, and standalone metadata remain unchanged.
@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts docker Docker and sandbox tooling size: S labels Oct 24, 2026
@steipete
steipete marked this pull request as ready for review October 24, 2026 03:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T04:04:44.239291Z f3bacbd Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete marked this pull request as draft October 24, 2026 03:46
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 24, 2026
@steipete
steipete marked this pull request as ready for review October 24, 2026 04:02
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Remove the redundant OpenTelemetry API peer from the private bundled AI package and reject installed SDKs whose required API cannot resolve.

Example: Install the candidate using Node 24.22.1 and npm 11.19.1 with Anthropic SDK 0.135.0.

  • Before: npm reports success but leaves @opentelemetry/api empty, preventing Gateway startup.
  • After: The reported candidate install populates API 1.10.0, and installed-package verification confirms dependency resolution.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused patch has no established correctness defect and meaningful regression coverage, but recorded product acceptance remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate. Its body records a real candidate npm install and successful required-API resolution, but explicitly leaves SDK import, Gateway startup, and upgrade acceptance incomplete.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A successful installation can produce a Gateway that cannot start because a mandatory SDK dependency is empty.
Reason: Restoring usable installed packages has clear value, and the maintainer-authored direction confines the change to private artifact metadata.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR addresses a concrete installation failure with a focused patch and no introduced defect found, while retaining its explicit landing hold.

Priority: P1
Reviewed head: f3bacbd608b754c68df8d908b2df90aef8cb9537

Before merge

  • Resolve merge risk - The package owner must resolve the recorded 49,094-entry candidate against the unchanged 47,500-entry acceptance budget before lifting the landing hold; this review does not attribute the excess to this diff.

Findings

None.

Tests

  • Missing end-to-end proof: The candidate SDK tracing import and Gateway startup remain unrun, including startup after upgrade; the combined update/rollback matrix remains owned by the linked update PR.
Agent review details

How this fits together

The canonical packager stages the private AI runtime into the OpenClaw tarball; npm installs its dependencies, and Package Acceptance checks the resulting installed tree.

flowchart TD
  A[Standalone AI package] --> B[Private package staging]
  B --> C[OpenClaw tarball]
  C --> D[npm installation]
  D --> E[Installed dependency verification]
  D --> F[Gateway runtime]
Loading

Technical review

Best possible solution:

Retain the narrow private-manifest repair and existing verification owner while satisfying the unchanged package acceptance contract.

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

Current source retains the reported bundled-peer trigger, and both PR bodies describe controlled npm reproductions and an actual startup failure; this read-only review did not independently execute the installation.

Is this the best way to solve the issue?

The patch fixes the metadata producer at the existing packaging owner, preserves standalone AI consumers and dependency versions, and adds a distinct installed-tree check without parallel machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6732eaa2b475.

Merge-risk options

Maintainer options:

  1. Resolve the existing candidate budget failure (recommended)
    The package owner should identify the largest installed-tree contributors and bring the candidate within the existing budget without raising the shipped-updater limits.

Provenance checked

  • Private AI package staging changes intended behavior with a stated reason (unknown: Existing staging assigns dependency ownership to the root and strips the private copy's dependency list. The typed migration carried this behavior forward; the older content search failed on unavailable blobs. The PR explains the narrowly extended peer removal with npm reproductions.)
  • Installed-package acceptance budgets keeps the original intent (8f98c12: Reject candidates before their installed trees exhaust immutable limits in published updaters, retaining installation-variance headroom.)
  • Standalone AI package contract keeps the original intent (062f88e: Provide a reusable self-contained AI package for external consumers; this patch changes only its private bundled copy.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 8f98c12 adds scripts/check-openclaw-installed-package-budget.mts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 8f98c12c581f; files: scripts/check-openclaw-installed-package-budget.mts)

PR surface

Tests +29, Docs +4, Other +24. Total +57 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 30 1 +29
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 2 24 0 +24
Total 5 58 1 +57

Review metrics

Metric Value Why it matters
Production versus regression coverage Packaging and verification +24/-0; tests +30/-1 The small production addition uses existing owners, while tests protect private package metadata and installed dependency rejection.

Labels

Label changes:

  • add P1: A reported successful npm installation can leave a mandatory dependency empty and prevent the Gateway from starting.
  • add merge-risk: 🚨 compatibility: The recorded candidate exceeds the existing acceptance budget intended to preserve installation headroom for already-shipped updaters; no limit change or causal attribution to this patch is implied.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Label justifications:

  • P1: A reported successful npm installation can leave a mandatory dependency empty and prevent the Gateway from starting.
  • merge-risk: 🚨 compatibility: The recorded candidate exceeds the existing acceptance budget intended to preserve installation headroom for already-shipped updaters; no limit change or causal attribution to this patch is implied.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.

Rank-up moves

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

  • Complete SDK import and Gateway startup on the installed candidate, including the upgrade installation path.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 24, 2026, 12:02 AM ET / 04:02 UTC.

@steipete
steipete enabled auto-merge (squash) October 24, 2026 04:05
@steipete
steipete merged commit e3d3962 into main Oct 24, 2026
295 of 325 checks passed
@steipete
steipete deleted the codex/nodew-r11-package-peer branch October 24, 2026 04:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
Drop the API peer only from the private bundled AI manifest to avoid npm returning an empty required dependency. Verify SDK API resolution during installed-package checks. Dependency versions, overrides, and standalone metadata remain unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. docker Docker and sandbox tooling docs Improvements or additions to documentation scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant