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)

Abierto
#94,440 0 comentarios 0 reacciones 0 asignados Ver en GitHub
area:desktop area:permissions bug platform:windows
Lenguaje dominante
Python
Estrellas
145k
Forks
23.1k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

### 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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.