Repository navigation
fix(plugins): preserve declared dependencies in source checkouts - #132811
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
eab6261 to
06c13fc
Compare
|
Codex review: found issues before merge. Reviewed August 29, 2026, 7:22 PM ET / 23:22 UTC. ClawSweeper reviewWhat this changesThe PR preserves plugin dependencies in source checkouts, stages npm package contents separately for publishing, and updates related build, cache, resolver, documentation, and test coverage. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open: the new isolated package staging tree drops the repository npm release-age policy before a portable optional-dependency install, creating a supply-chain policy bypass that must be repaired before merge. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s plugin publishing path collects bundled runtime dependencies and produces npm packages from plugin source directories. The staging wrapper feeds dependency recovery and npm packaging, which then produces the publishable plugin artifact. flowchart LR
A[Plugin source directory] --> B[Isolated package staging]
E[Repository npm policy] --> B
B --> C[Bundled dependency recovery]
C --> D[npm install]
D --> F[Publishable plugin artifact]
Before merge
Findings
Agent review detailsSecurityNeeds attention: The staged optional-dependency recovery install no longer inherits the repository npm release-age policy. PR surfaceTests +30, Docs +8, Config +2, Other -5. Total +35 across 16 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the isolated staging design, but propagate the canonical npm policy to its recovery install and add a registry-spec regression that proves the staged invocation receives it. Do we have a high-confidence way to reproduce the issue? No live reproduction was run in this read-only review, but source inspection establishes the introduced staged npm invocation and the missing project-policy boundary with high confidence. Is this the best way to solve the issue? No: isolating package contents is appropriate, but the staged install must preserve the repository npm policy and demonstrate that behavior for a registry dependency. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5d7b36c5a6c7. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
06c13fc to
54c043f
Compare
pnpm owns source dependency versions and workspace links. Remove both source pruning owners, isolate npm bundle staging, preserve importer trees in CI caches, and keep the Bun Undici workaround importer-relative. Source tests now exercise declared plugin versions after install and build. Packaged runtime cleanup remains unchanged; no dependency pins change. Related: #132385
54c043f to
9987d84
Compare
|
Ready to land 9987d847. Exact-head CI passed:126 successful jobs,11 skipped, including the rebuilt Chromium lane and required gate. The unchanged16-file repair preserves pnpm-owned source dependencies and isolates npm bundling in temporary staging (production/tooling net−3). Merged shutdown repairs #132820/#132824 and browser binding repair #132878 are inherited from main. Fresh12 shutdown +19 source tests pass on Node,19 source tests pass on Bun, actual Vite selects the declared Teams/Slack versions, and changed gates plus isolated Codex P0 review pass. Native review artifacts validate; the latest completed ClawSweeper review has no findings. Earlier failures and the local Chromium bootstrap limitation remain documented in the PR body; rebuilt exact-head CI supplies the full-flow proof. The latest ClawSweeper review has no code/security findings. Its remaining items are resolved: exact-head CI is complete, and the maintainer explicitly accepts this owner-boundary repair. I also directly inspected installed Vite8.2.2: Proceeding through native prepare/merge with matching-head final approval. No release, dependency pin, manifest, lockfile, or changelog change. |
|
Merged via squash.
|
…nclaw#132811) pnpm owns source dependency versions and workspace links. Remove both source pruning owners, isolate npm bundle staging, preserve importer trees in CI caches, and keep the Bun Undici workaround importer-relative. Source tests now exercise declared plugin versions after install and build. Packaged runtime cleanup remains unchanged; no dependency pins change. Related: openclaw#132385
Related: the source dependency-policy repair, which documented this follow-up for source-test dependency resolution after bundled-plugin pruning.
What Problem This Solves
Resolves a problem where developers running plugin source tests could silently exercise a different dependency version from the one declared and locked for that plugin after a normal install or build. At the reproduced main snapshot, Microsoft Teams declared
jose 6.2.10, but postinstall removed its valid plugin-local installation and the auth tests resolved hoisted6.2.9. Those tests still passed, concealing the mismatch. Slack had a related test-loader exception that forced root Undici instead of its declared version.Why This Change Was Made
pnpm is the canonical owner of source dependency versions and workspace links. Remove source dependency pruning from both postinstall and build preparation, while retaining packaged dist cleanup and source-checkout protection for operator state. npm dependency bundling now stages a separate temporary package tree rather than assuming pnpm's source tree was deleted; cleanup cannot remove or replace the source dependencies. The existing Bun Undici workaround becomes importer-relative, and CI dependency archives retain plugin importer trees.
No root dependency, dependency-pin change, new resolver alias, override, or runtime dependency repair is added. Packaged internal plugins retain their root-runtime dependency contract; external packages retain their existing bundled-dependency or registry-install policy. Production/tooling: +67/−70 (net −3). Tests/support: +332/−302 (net +30). Documentation: +22/−14.
User Impact
Source tests and builds retain the dependency versions selected for each plugin, including conflicting versions and workspace links. Existing checkouts whose dependencies were pruned can restore them with
pnpm install --frozen-lockfile. Plugin packaging keeps working without taking ownership of the source install. The source setup and dependency-resolution documentation describe the repaired boundary.AI-assisted implementation, reviewed by the maintainer. This is install/build/test tooling repair, not a change to Teams authentication policy or channel behavior.
Evidence
Reproduced at main
d4e41a61776026d38eebb05a5da92930b5c69be2. Before repair, canonical postinstall changed Teams' native resolution from localjose 6.2.10to hoisted6.2.9. Six new source/build regression cases failed because plugin versions fell back to the root version and workspace links disappeared. Packaging regression failed because the old bundler refused existing sourcenode_modules. The real Vite resolver regression also failed on Slack's root-pinned Undici import before the existing workaround was made importer-relative.After the repair:
jose 6.2.10; actual Vite resolution uses that package and Slack's declared Undici7.29.0.pnpm buildpassed in 27m 48.3s without ineffective-dynamic-import warnings. A post-build real Vite probe still resolved Teams’ plugin-localjose 6.2.10and Slack’s package-relative Undici7.29.0.tbx_01m176wvsxy5d0t4hxexk7z4zqcompleted with wrapper exit 0 and stopped. Frozen install, fullpnpm build, post-build source resolution and tests,scripts/release-check.ts(real packed-core installation and bundled-channel entrypoint smoke), and Slack/Teams package dry-runs passed. The backing Actions run may display cancellation from normal one-shot Testbox cleanup; the delegated command result was successful.Focused owner proof:
Proof limits: no authenticated Teams/Slack messaging or provider inference was needed or claimed. An additional instrumented local test run stalled and was stopped; it is not counted as proof, and ordinary Node/Bun reruns passed. No release or version publication is part of this PR. Exact-head PR CI will be recorded before landing; the local and clean Linux proof above does not substitute for it.
Publication: a native-wrapper trust check required a conflict-free mechanical refresh onto current main. The repair’s added/deleted bytes are unchanged. The previous head was
06c13fc974cbd3ffc9c3616d31f2a2c9dc878b60; exact-head PR CI failed: 124 jobs succeeded, 11 skipped, one test shard failed, and the required gate correctly failed. The initial head’s run was superseded and is not landing proof.Refresh proof and landing status
The former shutdown blocker is resolved upstream by native worker profile coverage and parent-consumed custom shutdown synchronization. This branch was rebased conflict-free onto
f12dab5833ae0ee572b7a1c3764efcb4b7151880, adopting both actual fixes. Range-diff confirms the same 16-file repair; there is no profiler/fixture delta, dependency pin/override change, or weakened assertion in this PR. First refreshed candidate:54c043f8c214face01b826412056718ec244bc20.Fresh recovery proof on this candidate:
pnpm install --frozen-lockfile: passed, including canonical postinstall; no lockfile changes.jose 6.2.10; Slack selects declaredundici 7.29.0.node scripts/run-vitest.mjs test/scripts/vitest-fork-shutdown.test.ts --maxWorkers 1 --reporter verbose node scripts/run-vitest.mjs test/vitest-dependency-resolution.test.ts extensions/msteams/src/auth-coverage.test.ts extensions/slack/src/native-data-blocks.test.ts src/test-utils/mock-http.test.ts --maxWorkers 1 bun --bun node_modules/vitest/vitest.mjs run --project unit-fast --project tooling --project extension-msteams --project extension-slack test/vitest-dependency-resolution.test.ts extensions/msteams/src/auth-coverage.test.ts extensions/slack/src/native-data-blocks.test.ts src/test-utils/mock-http.test.ts --maxWorkers 1 node scripts/run-vitest.mjs test/scripts/postinstall-bundled-plugins.test.ts test/scripts/tsdown-build.test.ts --maxWorkers 1 -t 'preserves importer dependency resolution|preserves separately owned outputs|keeps the packaged Mac app intact'Tooling notes: the direct Bun tooling wrapper failed before collection on a
tsxCJS-resolution error, so Bun proof uses the explicit Vitest run entry with unchanged repository configs. The workflow wrapper initially selected system Python 3.9 and could not install its pinned pre-commit; the unchanged wrapper passed with installed Python 3.14, including the pinned security hook. An initial ad hoc Vite probe used a nonexistent Slack importer; using the real source importer passed. These unsuccessful diagnostics are not counted as passing proof.The documented full local build and clean Linux packaged proof remain applicable: this refresh does not change npm staging or module boundaries. The only overlapping main build change preserves signed app output during cleanup, covered by the fresh owner cases. Exact-current-head CI and native landing status will be recorded below; no prepare or merge has been attempted.
Browser CI repair adoption
Run 33279260949 finished with 124 successful jobs, 11 skipped, and failures in Chromium shard 14/14 plus the aggregate gate. The Chromium test assertions passed, but two unhandled Playwright JSON errors came from foreign
Runtime.bindingCalledpayloads (before-enable/after-disable). The dependency repair did not touch that owner.Main already contained the exact repair in #132878, browser binding ownership and clipboard teardown, merged as
0dcbb900559944775bcca61452280e2f7383f007. The branch was refreshed conflict-free onto90c1d798cad44f0d1901524a613acef33a4e42b6to adopt it. Current candidate:9987d847cc39b8273c8b25ac36a0bf04b0984b80. Range-diff again confirms the same 16-file repair; no browser, clipboard, fixture, manifest, lockfile or changelog delta was added to this PR.Fresh proof on the second candidate: 31 Node cases passed (12 shutdown plus the same 19 source/resolver/auth/HTTP cases), 19 Bun cases passed, actual Vite importer versions remained correct, and all 40 upstream Runtime ownership cases passed. A fresh isolated Codex P0 autoreview reported no actionable findings. Changed-file and workflow gates passed.
The combined browser command is not a passing full-flow claim: its 40 Runtime tests passed, and Chromium exercised binding isolation, reconnect, labeled screenshots and tab creation without the CI JSON errors, then failed at native-host bootstrap while using the retained older built host artifact. Both generated screenshot proofs were inspected locally. The newly rebuilt exact-head Chromium CI lane must pass before landing; no assertion, timeout, dependency or runtime workaround was added.
Exact-head CI run33280125633 completed green on9987d847. All rebuilt UI E2E shards, including Chromium14/14, passed, resolving the browser full-flow proof gap. The canonical CI watcher exited0 with GREEN. The latest completed ClawSweeper review (22:51 UTC) has no actionable findings and asks only for normal exact-head CI and merge-result validation. Native review artifacts are current; prepare/merge await final approval.