Repository navigation
fix: allow Nix store plugin hardlinks - #79344
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. source-reproducible. Current main routes non-bundled plugin discovery, manifest, runtime, catalog, and external secret-contract reads through hardlink rejection, while the PR body gives a concrete Nix-store loader command with after-fix terminal output. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land a maintainer-reviewed, current-main version that preserves default external hardlink rejection and scopes the Nix exception to existing Nix mode plus resolved Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible. Current main routes non-bundled plugin discovery, manifest, runtime, catalog, and external secret-contract reads through hardlink rejection, while the PR body gives a concrete Nix-store loader command with after-fix terminal output. Is this the best way to solve the issue? Yes. A shared policy helper reused by all touched plugin-loading surfaces is the narrowest maintainable solution I found, and the PR keeps normal external plugin hardlink rejection unchanged. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 7ff5e0928981. |
3da5484 to
0d7993d
Compare
|
/clawsweeper |
|
🦞👀
|
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
0d7993d to
8e532f7
Compare
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper review |
1 similar comment
|
@clawsweeper review |
8e532f7 to
1fa50c4
Compare
Nix packages materialize plugin files as hardlinks in immutable store roots. Route discovery, manifest validation, channel catalogs, channel secret contracts, and runtime loading through one plugin hardlink policy so OPENCLAW_NIX_MODE accepts /nix/store plugin roots while normal external plugin hardlink rejection stays unchanged. Tests: - pnpm test src/secrets/channel-contract-api.external.test.ts src/plugins/hardlink-policy.test.ts - pnpm test src/plugins/manifest-registry.test.ts src/plugins/loader.test.ts - pnpm test src/plugins/discovery.test.ts src/plugins/channel-catalog-registry.test.ts - pnpm exec oxfmt --check --threads=1 src/plugins/channel-catalog-registry.ts src/plugins/discovery.ts src/plugins/hardlink-policy.ts src/plugins/loader.ts src/plugins/manifest-registry.ts src/secrets/channel-contract-api.ts src/plugins/hardlink-policy.test.ts src/plugins/manifest-registry.test.ts src/secrets/channel-contract-api.external.test.ts - pnpm check:changelog-attributions - git diff --check Co-authored-by: Codex <[email protected]>
Return undefined from the early-startup test stub so it satisfies the current chat run registry removal contract during core test typechecking. Tests: - pnpm check:changed - git diff --check Co-authored-by: Codex <[email protected]>
1fa50c4 to
7a8c089
Compare
Co-authored-by: Codex <[email protected]>
|
Merged via squash.
Thanks @joshp123! |
Merged via squash. Prepared head SHA: bf533f8 Co-authored-by: Codex <[email protected]> Reviewed-by: @joshp123
Merged via squash. Prepared head SHA: bf533f8 Co-authored-by: Codex <[email protected]> Reviewed-by: @joshp123
Merged via squash. Prepared head SHA: bf533f8 Co-authored-by: Codex <[email protected]> Reviewed-by: @joshp123
Summary
/nix/storeonly whenOPENCLAW_NIX_MODE=1removeChatRunreturn contract so the touched core-test gate typechecksReal Behavior Proof
/nix/storewere rejected as unsafe hardlinks before OpenClaw could load them. Normal non-Nix external plugin hardlink rejection remains unchanged.OPENCLAW_NIX_MODE=1, disabled bundled plugins, and an actual Nix-store plugin root at/nix/store/ingn1s4xpz25j9dzi01zs5xi80z70qyl-openclaw-weixin-runtime-plugin-2.4.2.{ "plugin": { "id": "openclaw-weixin", "status": "loaded", "origin": "config", "rootDir": "/nix/store/ingn1s4xpz25j9dzi01zs5xi80z70qyl-openclaw-weixin-runtime-plugin-2.4.2", "channelIds": ["openclaw-weixin"] }, "diagnostics": [ { "level": "warn", "message": "memory slot plugin not found or not marked as memory: memory-core" } ] }openclaw-weixinwithstatus: "loaded"andorigin: "config". Before this patch, the same Nix-store root was rejected during plugin manifest validation as an unsafe hardlink alias.Tests
pnpm check:changedpnpm test src/secrets/channel-contract-api.external.test.ts src/plugins/hardlink-policy.test.tspnpm test src/plugins/manifest-registry.test.ts src/plugins/loader.test.tspnpm test src/plugins/discovery.test.ts src/plugins/channel-catalog-registry.test.tspnpm exec oxfmt --check --threads=1 src/plugins/channel-catalog-registry.ts src/plugins/discovery.ts src/plugins/hardlink-policy.ts src/plugins/loader.ts src/plugins/manifest-registry.ts src/secrets/channel-contract-api.ts src/plugins/hardlink-policy.test.ts src/plugins/manifest-registry.test.ts src/secrets/channel-contract-api.external.test.ts src/gateway/server-startup-early.test.tspnpm check:changelog-attributionsgit diff --check