Workflow tool: permission handler rejects a scriptPath script with "script contains control characters that would be hidden in the approval dialog" although the script contains none (desktop app, Windows)
Status Open
Reported on v2.1.269
Maintainer reply None cached
Workaround ✓ Mentioned in description ↑
Activity 1 comment · opened Sep 15, 2026
Description
Calling the Workflow tool with scriptPath fails before any approval dialog appears. The permission handler resolves the script and then rejects its own updatedInput:
The permission handler returned updatedInput for Workflow that failed schema validation: [
{
"code": "custom",
"path": [ "script" ],
"message": "script contains control characters that would be hidden in the approval dialog"
}
]
This is a configuration issue in your canUseTool callback, PermissionRequest hook, or permission-prompt tool — updatedInput must satisfy the tool's input schema. The tool input from the model was valid.
The script file does not contain control characters:
- UTF-8, LF line endings (0
\r), no BOM, 0 tabs, ~8.8 KB - no C0/C1 controls, no zero-width / bidi / variation-selector characters (U+200B–U+200F, U+202A–U+202E, U+2060–U+2064, U+2066–U+2069, U+FE00–U+FE0F, U+FEFF)
- the only non-ASCII characters are ordinary typography:
─U+2500,—U+2014,·U+00B7,→U+2192
The project has no PermissionRequest hook and no custom permission-prompt tool, so the handler in question is the app's own.
Steps to reproduce
- A project with a workflow script at
.claude/workflows/<name>.js(starts withexport const meta = {...}), containing some of the typography characters above in comments/strings. - In the Claude desktop app (Code tab), have the model call Workflow with
{ scriptPath: ".claude/workflows/<name>.js", args: { ... } }. - Retry with ASCII-only
args— same error, so the args are not the trigger.
Expected
The approval dialog is shown (or the workflow runs), or — if a character really is disallowed — the error names the character and its offset.
Actual
Hard failure with the message above; the workflow never starts. Workaround: run the equivalent agents manually with the Agent tool.
Environment
- OS: Windows 11 Pro 10.0.26200
- Claude desktop app, Code tab
- Claude Code: 2.1.269 (Claude Code)
- Model: claude-opus-5
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗