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)

オープン
#94,440 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
area:desktop area:permissions bug platform:windows
主要言語
Python
スター
145k
フォーク
23.1k
PR マージ指標
PR 指標を取得中

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。