openclaw - 💡(How to fix) Fix [Bug] CLI fallback constructs MCP config path from cron task prompt string (2026.4.2) [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#61549Fetched 2026-04-08 02:57:29
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

When a cron job's CLI fallback session is initialised, the MCP config file path is incorrectly constructed using the full task prompt string instead of a valid filesystem path. Every CLI fallback attempt fails with Invalid MCP configuration: MCP config file not found.

Error Message

Error: Invalid MCP configuration:
MCP config file not found: /Users/<user>/.openclaw/workspace/[cron:<id> <job-name>] <full task prompt text...>

For jobs with longer prompts, the OS rejects the path entirely:

Error: ENAMETOOLONG: name too long

Root Cause

Root cause (apparent)

Code Example

Error: Invalid MCP configuration:
MCP config file not found: /Users/<user>/.openclaw/workspace/[cron:<id> <job-name>] <full task prompt text...>

---

Error: ENAMETOOLONG: name too long

---

~/.openclaw/workspace/[cron:{id} {name}] {entire prompt text}
RAW_BUFFERClick to expand / collapse

Bug type

Regression

Summary

When a cron job's CLI fallback session is initialised, the MCP config file path is incorrectly constructed using the full task prompt string instead of a valid filesystem path. Every CLI fallback attempt fails with Invalid MCP configuration: MCP config file not found.

Environment

  • OpenClaw version: 2026.4.2
  • OS: macOS 15 (arm64)
  • Install method: npm
  • Cron jobs: isolated mode

Error

Error: Invalid MCP configuration:
MCP config file not found: /Users/<user>/.openclaw/workspace/[cron:<id> <job-name>] <full task prompt text...>

For jobs with longer prompts, the OS rejects the path entirely:

Error: ENAMETOOLONG: name too long

Root cause (apparent)

The CLI fallback session setup is constructing the MCP config path using the cron session key template, which includes the full task prompt string. The result is a path like:

~/.openclaw/workspace/[cron:{id} {name}] {entire prompt text}

The workspace session key and the MCP config path appear to be sharing the same variable or template, causing the prompt to be concatenated into what should be a filesystem path.

Expected behaviour

MCP config resolves to the actual OpenClaw workspace config directory — independent of the task prompt.

Actual behaviour

MCP config path = session key + full task prompt → ENOENT or ENAMETOOLONG on every CLI fallback attempt.

Impact

CLI fallback is permanently broken for all isolated cron jobs. Any job where the primary model is unavailable will fail at the fallback step, regardless of whether the underlying task completed successfully.

extent analysis

TL;DR

The most likely fix is to modify the cron job's CLI fallback session initialization to construct the MCP config file path using a valid filesystem path instead of the full task prompt string.

Guidance

  • Review the cron session key template to ensure it does not include the full task prompt string, and update it to use a valid filesystem path.
  • Verify that the MCP config path is correctly resolved to the actual OpenClaw workspace config directory by checking the ~/.openclaw/workspace directory for the expected config file.
  • Consider adding a check to truncate or sanitize the task prompt string to prevent ENAMETOOLONG errors.
  • Investigate the code that constructs the MCP config path to determine why it is sharing the same variable or template as the workspace session key.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The fix may require updates to the OpenClaw configuration or the cron job setup, and may involve modifying the session key template or the code that constructs the MCP config path.

Recommendation

Apply a workaround by modifying the cron job's CLI fallback session initialization to use a hardcoded or dynamically generated valid filesystem path for the MCP config file, until a permanent fix can be implemented.

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 [Bug] CLI fallback constructs MCP config path from cron task prompt string (2026.4.2) [1 participants]