openclaw - 💡(How to fix) Fix Agent lane task fails with ENOENT: mkdir '/home/node' on macOS [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69739Fetched 2026-04-22 07:48:54
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Agent lane/session tasks on macOS consistently fail with:

Error: ENOENT: no such file or directory, mkdir '/home/node'

/home/node is a Linux-container convention (common in Docker images like node:22). On macOS hosts, /home doesn't exist and node's HOME is /Users/<user>. Something in the agent runner is trying to create /home/node unconditionally.

The error triggers a model fallback cascade (haiku → sonnet) and ultimately an Embedded agent failed before reply — so user-facing jobs (cron payloads, especially those with sessionTarget:"isolated") fail outright.

Error Message

Error: ENOENT: no such file or directory, mkdir '/home/node'

Root Cause

Agent lane/session tasks on macOS consistently fail with:

Error: ENOENT: no such file or directory, mkdir '/home/node'

/home/node is a Linux-container convention (common in Docker images like node:22). On macOS hosts, /home doesn't exist and node's HOME is /Users/<user>. Something in the agent runner is trying to create /home/node unconditionally.

The error triggers a model fallback cascade (haiku → sonnet) and ultimately an Embedded agent failed before reply — so user-facing jobs (cron payloads, especially those with sessionTarget:"isolated") fail outright.

Code Example

Error: ENOENT: no such file or directory, mkdir '/home/node'

---

$ grep -c 'home/node' ~/.openclaw/logs/*.log ~/.openclaw/logs/*.err.log
gateway.err.log:1347
gateway.log:87
sugi.err.log:513
sugi.log:204

---

2026-04-21T09:19:31.766  [diagnostic] lane task error: lane=main durationMs=285
  error="Error: ENOENT: no such file or directory, mkdir '/home/node'"
2026-04-21T09:19:31.771  [diagnostic] lane task error: lane=session:agent:main:main
  durationMs=291 error="Error: ENOENT: no such file or directory, mkdir '/home/node'"
2026-04-21T09:19:31.772  [model-fallback] model fallback decision: decision=candidate_failed
  requested=anthropic/claude-haiku-4-5-20251001 ... reason=unknown
  detail=ENOENT: no such file or directory, mkdir '/home/node'
2026-04-21T09:19:32.079  Embedded agent failed before reply:
  ENOENT: no such file or directory, mkdir '/home/node'
RAW_BUFFERClick to expand / collapse

Agent lane task fails with ENOENT: mkdir '/home/node' on macOS

Summary

Agent lane/session tasks on macOS consistently fail with:

Error: ENOENT: no such file or directory, mkdir '/home/node'

/home/node is a Linux-container convention (common in Docker images like node:22). On macOS hosts, /home doesn't exist and node's HOME is /Users/<user>. Something in the agent runner is trying to create /home/node unconditionally.

The error triggers a model fallback cascade (haiku → sonnet) and ultimately an Embedded agent failed before reply — so user-facing jobs (cron payloads, especially those with sessionTarget:"isolated") fail outright.

Environment

  • macOS 15.x (darwin 24.6.0), $HOME=/Users/robcolvin
  • Node 22 via Homebrew (/usr/local/opt/node@22/bin/node)
  • openclaw installed globally via npm

Symptom

Both gateway instances log the error repeatedly (hourly pattern):

$ grep -c 'home/node' ~/.openclaw/logs/*.log ~/.openclaw/logs/*.err.log
gateway.err.log:1347
gateway.log:87
sugi.err.log:513
sugi.log:204

Example context:

2026-04-21T09:19:31.766  [diagnostic] lane task error: lane=main durationMs=285
  error="Error: ENOENT: no such file or directory, mkdir '/home/node'"
2026-04-21T09:19:31.771  [diagnostic] lane task error: lane=session:agent:main:main
  durationMs=291 error="Error: ENOENT: no such file or directory, mkdir '/home/node'"
2026-04-21T09:19:31.772  [model-fallback] model fallback decision: decision=candidate_failed
  requested=anthropic/claude-haiku-4-5-20251001 ... reason=unknown
  detail=ENOENT: no such file or directory, mkdir '/home/node'
2026-04-21T09:19:32.079  Embedded agent failed before reply:
  ENOENT: no such file or directory, mkdir '/home/node'

The same error appears in cron run logs (e.g., ~/.openclaw/cron/runs/afternoon-todo-send.jsonl) as the lastError for sessionTarget:"isolated" jobs.

Likely cause

A hardcoded /home/node path somewhere in the agent-runner / sandbox setup. The fact that it's being invoked hourly even without cron triggers suggests this is also fired by some internal housekeeping lane (lane=main and lane=session:agent:main:main both fail with the same error).

Expected

Resolve HOME / workspace paths via os.homedir() or environment, not hardcoded Linux conventions.

Suggested fix

  • Replace any hardcoded /home/node with os.homedir() or a configurable path.
  • If the path is meant for a specific container/sandbox scenario, guard it behind a platform check (only attempt on Linux / in container runtime) or make it recover gracefully (use $TMPDIR as a fallback, catch ENOENT and create under the real home dir).

Happy to grep for the offending reference if you can point me at the source repo.

extent analysis

TL;DR

The issue can be resolved by replacing hardcoded /home/node paths with os.homedir() or a configurable path to accommodate different operating systems.

Guidance

  • Identify and replace any hardcoded /home/node references in the agent-runner or sandbox setup code with os.homedir() to dynamically resolve the user's home directory.
  • Implement a platform check to ensure the code behaves correctly across different operating systems, particularly for macOS where /home does not exist.
  • Consider adding error handling to catch ENOENT errors and provide a fallback solution, such as using $TMPDIR or creating the directory under the actual home directory.
  • Review the cron job configurations, especially those with sessionTarget:"isolated", to ensure they are not triggering the error due to hardcoded paths.

Example

const os = require('os');
const path = require('path');

// Before
const hardcodedPath = '/home/node';

// After
const dynamicPath = path.join(os.homedir(), 'node');

Notes

The provided solution assumes that the issue is indeed caused by hardcoded paths in the agent-runner or sandbox setup. Without access to the source code, it's challenging to provide a precise fix. The suggestions are based on the information given and may need adjustments based on the actual code implementation.

Recommendation

Apply the workaround by replacing hardcoded paths with dynamic resolutions using os.homedir() and implement platform checks to ensure compatibility across different operating systems. This approach should mitigate the ENOENT errors and prevent job failures.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Agent lane task fails with ENOENT: mkdir '/home/node' on macOS [1 participants]