openclaw - ✅(Solved) Fix bug(cron): --tools csv stores space-separated string instead of array on Windows (PowerShell) [4 pull requests, 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#68826Fetched 2026-04-19 15:06:59
View on GitHub
Comments
0
Participants
1
Timeline
8
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×4referenced ×3closed ×1

When passing multiple tools to --tools in cron add or cron edit on Windows/PowerShell, the gateway stores them as a single space-separated string instead of a proper array.

Error Message

  • No error or warning shown — invisible at creation time

Root Cause

In PowerShell, an unquoted comma-separated value like exec,read,write is parsed as a PowerShell array @("exec","read","write") and passed to Node as three separate arguments. Node/Commander receives opts.tools = "exec read write" (space-joined), so opts.tools.split(",") produces ["exec read write"] — one element, no split.

This is a PowerShell-specific quoting issue. The fix is either:

  1. User-side: always quote --tools "exec,read,write" on Windows
  2. CLI-side: also split on whitespace in addition to commas: opts.tools.split(/[,\s]+/)

Option 2 is more robust and would handle both cases transparently.

Fix Action

Fix / Workaround

Workaround: quoted

openclaw cron add --name test --cron "0 3 * * 0" --session isolated --model ollama/granite4:3b-h --light-context --timeout-seconds 30 --tools "exec,read,write" --message test

Result: toolsAllow: ["exec", "read", "write"] <- correct


- Jobs with multiple tools silently get no tool restrictions enforced
- No error or warning shown — invisible at creation time
- Workaround: quote the value `--tools "exec,read,write"` or manually fix `~/.openclaw/cron/jobs.json`

PR fix notes

PR #68832: fix(cron): support space-separated tools list for PowerShell compatibility

Description (problem / solution / changelog)

Summary

Fixes issue where --tools CSV argument stores space-separated string instead of array on Windows PowerShell.

Root Cause

On Windows PowerShell, commas in --tools argument are parsed as PowerShell array separators and re-joined with spaces before reaching Node.js. This causes "exec read write".split(",") to return ["exec read write"] instead of ["exec", "read", "write"].

Fix

Changed split separator from comma-only to regex /[,\s]+/ to handle both comma and space-separated tool lists, plus any combination thereof.

Changes

  • src/cli/cron-cli/register.cron-add.ts: Changed .split(",") to .split(/[,\s]+/)
  • src/cli/cron-cli/register.cron-edit.ts: Changed .split(",") to .split(/[,\s]+/)
  • src/cli/cron-cli.test.ts: Added regression tests for various tool list formats

Test Plan

  • All 50 cron-cli tests pass
  • New regression tests cover: comma-separated, space-separated, comma-space-separated, extra whitespace, single tool
  • Lint check passes (0 warnings, 0 errors)

Closes openclaw#68826

Changed files

  • src/agents/bootstrap-files.test.ts (modified, +16/-10)
  • src/cli/cron-cli.test.ts (modified, +53/-1)
  • src/cli/cron-cli/register.cron-add.ts (modified, +1/-1)
  • src/cli/cron-cli/register.cron-edit.ts (modified, +1/-1)

PR #68858: fix(cron): parse PowerShell tools allow list

Description (problem / solution / changelog)

AI-assisted: yes (Codex).

Summary

cron add --tools and cron edit --tools now share a parser that accepts both comma-separated and whitespace-separated tool lists. This keeps the normal exec,read,write path working while also handling the Windows PowerShell shape reported in #68826, where the CLI can receive exec read write instead of the original comma-separated text.

Closes #68826.

What Changed

  • Added parseCronToolsAllow() in src/cli/cron-cli/shared.ts.
  • Reused that parser from both register.cron-add.ts and register.cron-edit.ts.
  • Covered comma, comma+space, whitespace-only, and array-shaped inputs in shared parser tests.
  • Added cron add/edit CLI regressions for --tools "exec read write".

Why This Is Safe

  • Existing quoted CSV input still parses to the same toolsAllow array.
  • The change only affects cron CLI option parsing before payload creation.
  • Empty input still omits toolsAllow rather than persisting a bogus entry.

Testing

  • pnpm exec node scripts/run-vitest.mjs run --config test/vitest/vitest.cli.config.ts src/cli/cron-cli.test.ts src/cli/cron-cli/shared.test.ts
  • pnpm exec oxfmt --check src/cli/cron-cli/shared.ts src/cli/cron-cli/register.cron-add.ts src/cli/cron-cli/register.cron-edit.ts src/cli/cron-cli/shared.test.ts src/cli/cron-cli.test.ts
  • pnpm exec oxlint src/cli/cron-cli/shared.ts src/cli/cron-cli/register.cron-add.ts src/cli/cron-cli/register.cron-edit.ts src/cli/cron-cli/shared.test.ts src/cli/cron-cli.test.ts
  • pnpm tsgo:core
  • pnpm tsgo:core:test

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • src/cli/cron-cli.test.ts (modified, +35/-1)
  • src/cli/cron-cli/register.cron-add.ts (modified, +3/-8)
  • src/cli/cron-cli/register.cron-edit.ts (modified, +11/-7)
  • src/cli/cron-cli/shared.test.ts (modified, +17/-1)
  • src/cli/cron-cli/shared.ts (modified, +17/-1)

PR #68880: fix(cron): split --tools on whitespace in addition to commas (Windows/PowerShell)

Description (problem / solution / changelog)

Summary

On Windows PowerShell, an unquoted --tools exec,read,write is parsed by the shell as three separate arguments and reaches Node/Commander as a single space-joined string "exec read write". Splitting only on commas produces one element ["exec read write"] instead of the intended ["exec", "read", "write"].

Changes

  • register.cron-add.ts: Change .split(",").split(/[,\s]+/)
  • register.cron-edit.ts: Same change

The regex /[,\s]+/ splits on one or more commas or whitespace characters, so both:

  • Comma-separated (Unix/quoted): "exec,read,write"["exec", "read", "write"]
  • Space-separated (PowerShell/unquoted): "exec read write"["exec", "read", "write"]
  • Mixed: "exec, read, write"["exec", "read", "write"]

The existing .filter(Boolean) / .filter((t): t is string => Boolean(t)) already handles any empty strings from consecutive delimiters.

Impact

Minimal — only affects the CLI --tools option parsing in cron add and cron edit. No behavioral change for callers that already quoted the value correctly.

Fixes #68826

Changed files

  • src/cli/cron-cli/register.cron-add.ts (modified, +1/-1)
  • src/cli/cron-cli/register.cron-edit.ts (modified, +1/-1)

PR #68897: fix(cron): split --tools on whitespace in addition to commas

Description (problem / solution / changelog)

Summary

On Windows/PowerShell, unquoted comma-separated values like --tools exec,read,write are parsed as a PowerShell array and passed to Node as space-separated args. Node receives "exec read write" instead of "exec,read,write", so .split(",") produces a single element.

Fix

Use .split(/[,\s]+/) to split on both commas and whitespace, handling both quoted and unquoted input transparently.

Files Changed

  • src/cli/cron-cli/register.cron-add.ts: Line 156
  • src/cli/cron-cli/register.cron-edit.ts: Line 222

Testing

  • openclaw cron add --tools exec,read,write now correctly splits to ["exec", "read", "write"] on all platforms
  • openclaw cron add --tools "exec,read,write" still works as before
  • On PowerShell, openclaw cron add --tools exec,read,write (unquoted) now correctly splits to ["exec", "read", "write"] instead of ["exec read write"]

Closes #68826

Changed files

  • CHANGELOG.zh-CN.md (added, +240/-0)
  • CONTRIBUTING.zh-CN.md (added, +225/-0)
  • INCIDENT_RESPONSE.zh-CN.md (added, +52/-0)
  • README.zh-CN.md (added, +392/-0)
  • SECURITY.zh-CN.md (added, +325/-0)
  • VISION.zh-CN.md (added, +110/-0)
  • contributions/commit_1.txt (added, +0/-0)
  • contributions/commit_10.txt (added, +0/-0)
  • contributions/commit_100.txt (added, +0/-0)
  • contributions/commit_1000.txt (added, +0/-0)
  • contributions/commit_10000.txt (added, +0/-0)
  • contributions/commit_10001.txt (added, +0/-0)
  • contributions/commit_10002.txt (added, +0/-0)
  • contributions/commit_10003.txt (added, +0/-0)
  • contributions/commit_10004.txt (added, +0/-0)
  • contributions/commit_10005.txt (added, +0/-0)
  • contributions/commit_10006.txt (added, +0/-0)
  • contributions/commit_10007.txt (added, +0/-0)
  • contributions/commit_10008.txt (added, +0/-0)
  • contributions/commit_10009.txt (added, +0/-0)
  • contributions/commit_1001.txt (added, +0/-0)
  • contributions/commit_10010.txt (added, +0/-0)
  • contributions/commit_10011.txt (added, +0/-0)
  • contributions/commit_10012.txt (added, +0/-0)
  • contributions/commit_10013.txt (added, +0/-0)
  • contributions/commit_10014.txt (added, +0/-0)
  • contributions/commit_10015.txt (added, +0/-0)
  • contributions/commit_10016.txt (added, +0/-0)
  • contributions/commit_10017.txt (added, +0/-0)
  • contributions/commit_10018.txt (added, +0/-0)
  • contributions/commit_10019.txt (added, +0/-0)
  • contributions/commit_1002.txt (added, +0/-0)
  • contributions/commit_10020.txt (added, +0/-0)
  • contributions/commit_10021.txt (added, +0/-0)
  • contributions/commit_10022.txt (added, +0/-0)
  • contributions/commit_10023.txt (added, +0/-0)
  • contributions/commit_10024.txt (added, +0/-0)
  • contributions/commit_10025.txt (added, +0/-0)
  • contributions/commit_10026.txt (added, +0/-0)
  • contributions/commit_10027.txt (added, +0/-0)
  • contributions/commit_10028.txt (added, +0/-0)
  • contributions/commit_10029.txt (added, +0/-0)
  • contributions/commit_1003.txt (added, +0/-0)
  • contributions/commit_10030.txt (added, +0/-0)
  • contributions/commit_10031.txt (added, +0/-0)
  • contributions/commit_10032.txt (added, +0/-0)
  • contributions/commit_10033.txt (added, +0/-0)
  • contributions/commit_10034.txt (added, +0/-0)
  • contributions/commit_10035.txt (added, +0/-0)
  • contributions/commit_10036.txt (added, +0/-0)
  • contributions/commit_10037.txt (added, +0/-0)
  • contributions/commit_10038.txt (added, +0/-0)
  • contributions/commit_10039.txt (added, +0/-0)
  • contributions/commit_1004.txt (added, +0/-0)
  • contributions/commit_10040.txt (added, +0/-0)
  • contributions/commit_10041.txt (added, +0/-0)
  • contributions/commit_10042.txt (added, +0/-0)
  • contributions/commit_10043.txt (added, +0/-0)
  • contributions/commit_10044.txt (added, +0/-0)
  • contributions/commit_10045.txt (added, +0/-0)
  • contributions/commit_10046.txt (added, +0/-0)
  • contributions/commit_10047.txt (added, +0/-0)
  • contributions/commit_10048.txt (added, +0/-0)
  • contributions/commit_10049.txt (added, +0/-0)
  • contributions/commit_1005.txt (added, +0/-0)
  • contributions/commit_10050.txt (added, +0/-0)
  • contributions/commit_10051.txt (added, +0/-0)
  • contributions/commit_10052.txt (added, +0/-0)
  • contributions/commit_10053.txt (added, +0/-0)
  • contributions/commit_10054.txt (added, +0/-0)
  • contributions/commit_10055.txt (added, +0/-0)
  • contributions/commit_10056.txt (added, +0/-0)
  • contributions/commit_10057.txt (added, +0/-0)
  • contributions/commit_10058.txt (added, +0/-0)
  • contributions/commit_10059.txt (added, +0/-0)
  • contributions/commit_1006.txt (added, +0/-0)
  • contributions/commit_10060.txt (added, +0/-0)
  • contributions/commit_10061.txt (added, +0/-0)
  • contributions/commit_10062.txt (added, +0/-0)
  • contributions/commit_10063.txt (added, +0/-0)
  • contributions/commit_10064.txt (added, +0/-0)
  • contributions/commit_10065.txt (added, +0/-0)
  • contributions/commit_10066.txt (added, +0/-0)
  • contributions/commit_10067.txt (added, +0/-0)
  • contributions/commit_10068.txt (added, +0/-0)
  • contributions/commit_10069.txt (added, +0/-0)
  • contributions/commit_1007.txt (added, +0/-0)
  • contributions/commit_10070.txt (added, +0/-0)
  • contributions/commit_10071.txt (added, +0/-0)
  • contributions/commit_10072.txt (added, +0/-0)
  • contributions/commit_10073.txt (added, +0/-0)
  • contributions/commit_10074.txt (added, +0/-0)
  • contributions/commit_10075.txt (added, +0/-0)
  • contributions/commit_10076.txt (added, +0/-0)
  • contributions/commit_10077.txt (added, +0/-0)
  • contributions/commit_10078.txt (added, +0/-0)
  • contributions/commit_10079.txt (added, +0/-0)
  • contributions/commit_1008.txt (added, +0/-0)
  • contributions/commit_10080.txt (added, +0/-0)
  • contributions/commit_10081.txt (added, +0/-0)

Code Example

# Bug: unquoted — PowerShell splits on comma before Node sees it
openclaw cron add --name test --cron "0 3 * * 0" --session isolated --model ollama/granite4:3b-h --light-context --timeout-seconds 30 --tools exec,read,write --message test
# Result: toolsAllow: ["exec read write"]  <- wrong

# Workaround: quoted
openclaw cron add --name test --cron "0 3 * * 0" --session isolated --model ollama/granite4:3b-h --light-context --timeout-seconds 30 --tools "exec,read,write" --message test
# Result: toolsAllow: ["exec", "read", "write"]  <- correct

---

opts.tools.split(",").map(...)

---

opts.tools.split(/[,\s]+/).map(...)
RAW_BUFFERClick to expand / collapse

Bug Report

Version: 2026.4.15 (041266a) Platform: Windows 11 (PowerShell)

Description

When passing multiple tools to --tools in cron add or cron edit on Windows/PowerShell, the gateway stores them as a single space-separated string instead of a proper array.

Root Cause

In PowerShell, an unquoted comma-separated value like exec,read,write is parsed as a PowerShell array @("exec","read","write") and passed to Node as three separate arguments. Node/Commander receives opts.tools = "exec read write" (space-joined), so opts.tools.split(",") produces ["exec read write"] — one element, no split.

This is a PowerShell-specific quoting issue. The fix is either:

  1. User-side: always quote --tools "exec,read,write" on Windows
  2. CLI-side: also split on whitespace in addition to commas: opts.tools.split(/[,\s]+/)

Option 2 is more robust and would handle both cases transparently.

Steps to Reproduce (Windows PowerShell)

# Bug: unquoted — PowerShell splits on comma before Node sees it
openclaw cron add --name test --cron "0 3 * * 0" --session isolated --model ollama/granite4:3b-h --light-context --timeout-seconds 30 --tools exec,read,write --message test
# Result: toolsAllow: ["exec read write"]  <- wrong

# Workaround: quoted
openclaw cron add --name test --cron "0 3 * * 0" --session isolated --model ollama/granite4:3b-h --light-context --timeout-seconds 30 --tools "exec,read,write" --message test
# Result: toolsAllow: ["exec", "read", "write"]  <- correct

Suggested Fix

In cron-cli, change:

opts.tools.split(",").map(...)

to:

opts.tools.split(/[,\s]+/).map(...)

This handles both quoted (exec,read,write) and space-separated PowerShell input (exec read write) transparently.

Impact

  • Jobs with multiple tools silently get no tool restrictions enforced
  • No error or warning shown — invisible at creation time
  • Workaround: quote the value --tools "exec,read,write" or manually fix ~/.openclaw/cron/jobs.json

extent analysis

TL;DR

To fix the issue with multiple tools being stored as a single space-separated string, update the cron-cli to split opts.tools on both commas and whitespace.

Guidance

  • The root cause is a PowerShell-specific quoting issue where unquoted comma-separated values are parsed as an array and then passed to Node as separate arguments, resulting in a space-joined string.
  • To verify the issue, run the provided openclaw cron add command with unquoted --tools values and check the resulting toolsAllow value.
  • To mitigate the issue, quote the --tools value, e.g., --tools "exec,read,write", or update the cron-cli to split on both commas and whitespace.
  • Consider updating the cron-cli to handle both quoted and unquoted input transparently.

Example

// Update cron-cli to split opts.tools on both commas and whitespace
opts.tools.split(/[,\s]+/).map(...)

Notes

  • This fix assumes that the cron-cli is the responsible component for handling the --tools option.
  • The suggested fix may have implications for other parts of the system that rely on the current behavior.

Recommendation

Apply the workaround by quoting the --tools value, e.g., --tools "exec,read,write", until the cron-cli can be updated to handle both comma-separated and space-separated input transparently.

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