Skip to content

fix: plugin packaging fails on deduplicated dependency files - #197819

Merged
steipete merged 1 commit into
mainfrom
fix/2430-patched-pack-hardlinks
Nov 12, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/2430-patched-pack-hardlinks

Conversation

@steipete

@steipete steipete commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes plugin package preparation failing when a patched dependency contains identical files deduplicated into hardlinks, as with Acorn’s declaration files in Linux CI.

User Impact

Codex packaging can include its approved Acorn patch without failing before the Docker seed tests. Package contents and public dependency versions stay the same; installed dependencies are not modified.

Why This Change Was Made

npm’s tar writer fails with Z_STREAM_ERROR when the declaration paths share an inode. Copy the approved patched package into the existing temporary packing directory before invoking npm; its existing cleanup owns the copy. This adds three production lines and 15 test lines, with no new configuration, cache, retry, dependency patch, or version change.

#196785 (7ea57a8cba1aa8ada672ef967956bd87ea316558) exposed the defect by adding patched Acorn bundling to Codex. The last green full-run source already had the same Node version and Linux hardlink install policy. This is a newly exposed packaging regression, not an attribution of earlier unrelated Docker failures.

Evidence

  • Actual full-proof Docker failure: a temporary observer captured ZlibError / Z_STREAM_ERROR in npm 11.19.1’s tar 7.5.22 under Node 24.22.1. The observer is not part of this change.
  • Deterministic real npm control: independent Acorn files and external hardlinks pass; deduplicating its identical declaration files into one inode fails with the identical hosted stack. The repair passes with identical tarball integrity and extracted file bytes.
  • Extended the existing isolated-package test through the real manifest entry point: fails before the repair at patched dependency packing, then passes with both declarations published and the installed hardlink unchanged. All 57 affected-file cases pass: 93.34 seconds in Vitest, 98.54 seconds wall, repaired case 2.575 seconds. Existing real pack/install and registry contracts account for the file’s cost; no cases or production test hooks were added.
  • A/A measurement on 11 files / 572,269 bytes: independent-file packing took 429.25 / 237.17 ms (first cold); repaired packing took 257.13 / 234.70 ms. Warm control CPU was 0.25 seconds user / 0.09 system versus 0.26 / 0.11 and 0.24 / 0.10. Peak footprint was 19.71 MB versus 20.91 / 20.27 MB. Owner retained-heap growth was 295,896 bytes versus 297,808 / 298,280 bytes; this is heap-use observation, not total allocation count. No performance improvement is claimed.
  • Focused format, pnpm check:changed (including script and tooling-test types), and fresh Codex P2 review passed. Exact-head ordinary CI passed (30 successful jobs, 31 skipped), and final-head ClawSweeper has zero open items. Docker was skipped in ordinary CI. Actual Linux Docker coverage and the first scheduled full run containing all repairs remain explicit post-merge obligations; neither is claimed green.

Landing uses the native scripts/pr workflow; no maintainer fallback is planned.

@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the final head, 76a3dc9. The real npm hardlink regression fails on the parent and passes with the repair; all 57 affected packaging cases, required changed-file checks, and local Codex review are green. The temporary diagnostic observer is excluded. Actual Linux candidate packaging remains pending in hosted CI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T16:06:15.595786Z 76a3dc9 PR opened
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: XS labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Copy approved patched dependencies into the existing temporary directory before npm packs them, separating hardlinked files without changing the installed dependency.

Example: Acorn 8.19.0 has identical declaration files sharing an inode in Linux CI.

  • Before: Packing the installed dependency reportedly fails with Z_STREAM_ERROR.
  • After: npm packs independent copied files while the installed declaration files remain hardlinked.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and has a meaningful production-path packaging regression; validation confidence rests on the reported controls and harness evidence.
Proof confidence 🦐 gold shrimp (3/6) This packaging-script repair has no application-facing behavior requiring separate live proof; supplied real-npm controls and the CLI pack/install regression support the changed boundary, while hosted candidate validation remains pending.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Plugin artifact preparation fails when approved patched dependency files share an inode.
Reason: The maintainer-authored repair restores the intended packaging contract with a small change at its existing owner.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

✅ Ready for maintainer review

This PR provides a focused repair for a concrete packaging failure still present on main; no actionable correctness or security findings were identified.

Priority: P2
Reviewed head: 76a3dc91d93ecd35785e2895e068c567a8d906aa

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared plugin packaging owner validates installed workspace patches, produces temporary dependency tarballs, and installs them into staged npm and ClawHub packages.

flowchart LR
  A[Frozen workspace dependency] --> B[Patch identity validation]
  B --> C[Temporary independent copy]
  C --> D[npm pack]
  D --> E[Integrity checked tarball]
  E --> F[Staged plugin package]
  F --> G[Temporary input cleanup]
Loading

Technical review

Best possible solution:

Keep the existing validated packaging owner and normalize its npm input through an independent temporary copy.

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

The supplied real-npm controls describe a deterministic hardlink trigger, and the committed CLI regression exercises that input; this read-only review did not execute it.

Is this the best way to solve the issue?

The repair addresses the incompatible inode layout at the shared packing boundary, reuses existing cleanup, and adds no parallel packaging implementation or dependency change.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Packing verified patched dependencies keeps the original intent (c093e85: Preserve approved installed patch bytes in npm and ClawHub artifacts through canonical npm packing, integrity verification, and temporary staging.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c093e85 adds scripts/lib/plugin-npm-package-manifest.mts:643 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c093e85957b6; files: scripts/lib/plugin-npm-package-manifest.mts)

PR surface

Tests +15, Other +3. Total +18 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 0 +15
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 1 +3
Total 2 19 1 +18

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: A concrete failure blocks patched-dependency packaging in Linux CI, with a narrow build-tooling repair and no demonstrated released-runtime outage.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: A concrete failure blocks patched-dependency packaging in Linux CI, with a narrow build-tooling repair and no demonstrated released-runtime outage.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

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 November 12, 2026, 11:09 AM ET / 16:09 UTC.

@steipete
steipete merged commit 81192e4 into main Nov 12, 2026
127 of 128 checks passed
@steipete
steipete deleted the fix/2430-patched-pack-hardlinks branch November 12, 2026 16:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
RomneyDa added a commit that referenced this pull request Nov 19, 2026
Backport #197819 (81192e4), preserving the candidate package policy. Copy the frozen dependency into the existing temporary pack tree; retain hardlink regression coverage.

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XS 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