Hey, getting spawn ENAMETOOLONG when OpenClaw tries to use claude-cli as a fallback on Windows. Ran /context detail and my system prompt is ~58k chars total (44k prompt + 41 skills). Seems like it's hitting the Windows command-line length limit when passing the prompt as an argument. Windows 11, OpenClaw 2026.4.23, Node 24.15.0.
#ENAMETOOLONG
1 messages · Page 1 of 1 (latest)
Yep, your diagnosis looks right. I checked 2026.4.23 and npm latest 2026.4.24: Claude CLI is still wired with --append-system-prompt, so that ~58k prompt can blow past Windows’ command-line limit and produce spawn ENAMETOOLONG.
Short-term workarounds:
openclaw models fallbacks list
openclaw models fallbacks remove claude-cli/<that-model>
# or, if acceptable:
openclaw models fallbacks clear
openclaw gateway restart
If you need Claude CLI specifically, shrink the prompt for now — e.g. restrict skills via agents.defaults.skills — or try running from current source/main; the source tree I checked has moved Claude CLI to --append-system-prompt-file, which should avoid this class of failure.
This is worth filing as a bug: https://github.com/openclaw/openclaw/issues
Include Windows 11, OpenClaw 2026.4.23, Node 24.15.0, the spawn ENAMETOOLONG stack/log line, openclaw models fallbacks list, and the /context detail counts — no need to paste the full prompt.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\sshcs> claude --version
2.1.119 (Claude Code)
PS C:\Users\sshcs> claude -p "say hi"
Hi! How can I help you today?
PS C:\Users\sshcs> openclaw models fallbacks list
🦞 OpenClaw 2026.4.23 (a979721) — I'm the assistant your terminal demanded, not the one your sleep schedule requested.
Fallbacks (3):
- openai-codex/gpt-5.4
- openai/gpt-4.1
- claude-cli/claude-sonnet-4-5
PS C:\Users\sshcs> openclaw models fallbacks remove claude-cli/claude-sonnet-4-5
🦞 OpenClaw 2026.4.23 (a979721) — Alexa, but with taste.
Config write rejected: C:\Users\sshcs.openclaw\openclaw.json (size-drop:19878->7854). Rejected payload saved to C:\Users\sshcs.openclaw\openclaw.json.rejected.2026-04-27T03-30-00-243Z.
Error: Config write rejected: C:\Users\sshcs.openclaw\openclaw.json (size-drop:19878->7854). Rejected payload saved to C:\Users\sshcs.openclaw\openclaw.json.rejected.2026-04-27T03-30-00-243Z.
PS C:\Users\sshcs>
Oof, that’s a second bug-ish thing: the fallback removal hit the config writer’s “this looks like a destructive rewrite” guard. Good news: it did not change your active config.
For now I’d avoid using the rejected file blindly. Do this manually:
notepad $env:USERPROFILE\.openclaw\openclaw.json
Find the fallback list under agents.defaults.model.fallbacks and remove just:
"claude-cli/claude-sonnet-4-5"
Then:
openclaw config validate
openclaw gateway restart
openclaw models fallbacks list
You want the list to be only:
openai-codex/gpt-5.4
openai/gpt-4.1
Also include this Config write rejected (size-drop:19878->7854) in the GitHub issue — that’s separate useful evidence from the original Windows ENAMETOOLONG problem.
Hey, just removed claude-cli as a fallback because of the ENAMETOOLONG issue on Windows (58k char context hitting the argv limit). Is there any way to use claude-cli as a fallback without hitting this? I saw the source has moved to --append-system-prompt-file — is that in a release yet or is there a workaround in the meantime?