Skip to content

fix(plugins): publish git installs across devices#99929

Closed
qingminglong wants to merge 2 commits into
openclaw:mainfrom
qingminglong:codex/99885-git-install-exdev
Closed

fix(plugins): publish git installs across devices#99929
qingminglong wants to merge 2 commits into
openclaw:mainfrom
qingminglong:codex/99885-git-install-exdev

Conversation

@qingminglong

@qingminglong qingminglong commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Closes #99885

What Problem This Solves

Fixes an issue where users installing git-backed plugins in Docker or other split-filesystem setups would hit EXDEV: cross-device link not permitted when OpenClaw tried to publish the cloned repository from the process temp directory into the managed git plugin directory.

Why This Change Was Made

The managed git repo publish step now keeps the existing backup/restore behavior but uses the existing cross-device-safe move helper for both backup and final publish moves. That preserves the previous rollback semantics while allowing the final staged clone to be copied through the helper when a direct rename cannot cross filesystems.

User Impact

Users can install git: plugins when /tmp and the OpenClaw state directory live on different mounts, such as Docker containers with bind-mounted home or state directories. Existing install failure behavior and security success events remain unchanged when publishing fails.

Evidence

  • Claim proved: git plugin install publishing falls back successfully when the final managed repo rename raises EXDEV, while still emitting the install success event only after the repo is published.
  • Commands / artifacts:
    • node scripts/run-vitest.mjs src/plugins/git-install.test.ts -> 21 tests passed.
    • node scripts/run-vitest.mjs src/plugins/git-install.test.ts src/infra/install-package-dir.test.ts src/infra/replace-file.test.ts -> 2 Vitest shards passed; src/infra/install-package-dir.test.ts and src/infra/replace-file.test.ts covered the shared copy-fallback helper behavior, with platform-specific hardlink cases skipped on Windows as expected.
    • .\node_modules\.bin\oxfmt.CMD --check --threads=1 src/plugins/git-install.ts src/plugins/git-install.test.ts -> all matched files use the correct format.
    • .\node_modules\.bin\oxlint.CMD --tsconfig config/tsconfig/oxlint.core.json src/plugins/git-install.ts src/plugins/git-install.test.ts -> no issues reported.
    • git diff --check -> passed.
  • Observed result: the focused regression test forces the final repo -> managed git repo rename to throw EXDEV, then verifies the install succeeds and the managed repo contains the staged marker file.
  • Not tested / proof gaps: I did not run a live Docker bind-mount install; the proof is a source-level regression test against the exact publish boundary plus the existing infra fallback tests.

@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: the same linked git plugin EXDEV bug is already owned by an open, mergeable, proof-sufficient sibling PR that ClawSweeper previously reviewed as the better same-filesystem staging fix; this branch is a plausible alternate copy-fallback publish path but does not add unique work that should remain open separately.

Root-cause cluster
Relationship: superseded
Canonical: #99896
Summary: This PR and the sibling PR target the same canonical git plugin install EXDEV issue, but the sibling PR is the viable proof-positive landing candidate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Live PR data shows #99896 is open, not draft, mergeable, labeled proof: sufficient, and has passing relevant plugin/type/lint checks at head b8e86a1.

So I’m closing this here and keeping the remaining discussion on #99896.

Review details

Best possible solution:

Use the proven same-filesystem staging PR as the landing path, then let the linked canonical issue close when that fix merges.

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

Yes. Current main stages git plugin clones under os.tmpdir() and then publishes the staged repository through a rename-only replacement path, which source-proves the EXDEV failure when temp and managed git roots are on different filesystems.

Is this the best way to solve the issue?

No. This PR is a plausible implementation, but the better current path is the open sibling PR that stages on the managed git filesystem, preserves the existing replacement primitive, and has accepted real split-filesystem proof.

Security review:

Security review cleared: The diff changes local plugin install filesystem moves and tests without dependency, lockfile, workflow, permission, secret-handling, or new code-execution surface changes.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • steipete: GitHub commit metadata shows this account authored the commit that added src/plugins/git-install.ts and the surrounding git plugin install surface. (role: introduced git install behavior; confidence: high; commits: 7ddf28c0d440; files: src/plugins/git-install.ts, src/plugins/git-install.test.ts, src/cli/plugins-install-command.ts)
  • vincentkoc: Current blame and GitHub commit metadata show recent work on the managed git install lifecycle, security provenance, and fs-safe replacement wrapper used by this fix area. (role: recent area contributor; confidence: high; commits: 29814252e8e3, e302353d6187, 122f29e5ea37; files: src/plugins/git-install.ts, src/plugins/install.ts, src/infra/install-source-utils.ts)
  • joshavant: GitHub commit metadata shows this account touched the git installer’s install-policy and security-scan path that both candidate fixes need to preserve. (role: adjacent install policy contributor; confidence: medium; commits: 154f439c8103; files: src/plugins/git-install.ts, src/plugins/install-security-scan.ts, src/cli/plugins-install-command.ts)

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

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 4, 2026
@clawsweeper

clawsweeper Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EXDEV: cross-device link error during git plugin install in Docker containers

1 participant