-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: plugin temp-dir tests fail on any host where /tmp/openclaw is preferable (env-coupled os.tmpdir assertions) #101876
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.bugSomething isn't workingSomething isn't workingclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Priority
None yet
What happened?
Three plugin test cases fail on any POSIX machine where
/tmp/openclawexists or can be created with safe ownership (developer laptops after any OpenClaw run, warm CI boxes, remote test hosts):src/plugins/git-install.test.ts > installPluginFromGitSpec > falls back to OS temp when target workspace creation failssrc/plugins/manifest-model-id-normalization.test.ts > manifest model id normalization > reuses manifest metadata while file fingerprints are unchangedsrc/plugins/tools.optional.test.ts > resolvePluginTools optional tools > reloads when gateway binding would otherwise reuse a default-mode active registryExample failure:
Mechanism
withTempDir(src/infra/install-source-utils.ts) defaults its root toresolvePreferredOpenClawTmpDir()(src/infra/tmp-openclaw-dir.ts), which on POSIX prefers — and creates on demand —POSIX_OPENCLAW_TMP_DIR = "/tmp/openclaw"whenever ownership/permissions are safe, falling back toos.tmpdir()only when that is unsafe. The tests assert the fallback lands underos.tmpdir(), which only holds in environments where/tmp/openclawresolves unsafe (e.g. CI uid mismatch). The assertions encode the environment, not the contract.Reproduction
node scripts/run-vitest.mjs src/plugins/git-install.test.tson macOS or Linux as a user that can own/tmp/openclaw→ 3 failures. Verified 2026-07-07 on macOS (worktree of 6683a86) and a clean Linux box (both with/tmp/openclawabsent-then-created and pre-existing): 3 failed / 95 passed each time. All three test files and their prod modules are byte-identical toorigin/main(last touched by #99896).Expected
Tests should pin the temp-root resolution (inject
resolvePreferredOpenClawTmpDirOptions/ the resolver dep, or assert againstresolvePreferredOpenClawTmpDir()instead ofos.tmpdir()) so they pass regardless of host/tmp/openclawstate.