anthropics / anthropics/claude-code

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)

Ouverte
#94,440 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
area:desktop area:permissions bug platform:windows
Langage dominant
Python
Étoiles
145k
Forks
23.1k
Métriques de merge des PR
Métriques de PR en attente

Description

### 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
1. A project with a workflow script at `.claude/workflows/.js` (starts with `export const meta = {...}`), containing some of the typography characters above in comments/strings.
2. In the Claude desktop app (Code tab), have the model call Workflow with `{ scriptPath: ".claude/workflows/.js", args: { ... } }`.
3. 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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.