story-kit: create 212_bug_permission_hook_returns_invalid_response_blocking_edit_and_write_tools

This commit is contained in:
Dave
2026-02-26 15:31:50 +00:00
parent 60278064c8
commit 32a9ef779a

View File

@@ -0,0 +1,28 @@
---
name: "Permission hook returns invalid response blocking Edit and Write tools"
---
# Bug 212: Permission hook returns invalid response blocking Edit and Write tools
## Description
When Claude Code attempts to use the Edit or Write tools on files in the project root (e.g. README.md), the permission hook returns an invalid response that causes the tool call to fail. The error indicates the hook response is missing a required `message` field when the `behavior` is not "allow".
## How to Reproduce
1. Ask Claude Code to edit README.md using the Edit or Write tool
2. The permission hook fires and returns an invalid response
3. The tool call fails with a schema validation error about `behavior` and missing `message` field
## Actual Result
Edit and Write tools fail with error: `Invalid input: expected "allow"` / `expected string, received undefined` for `message` field. The hook response doesn't conform to the expected schema.
## Expected Result
The permission hook should return a valid response — either `{ behavior: "allow" }` or `{ behavior: "deny", message: "reason" }` — so that Edit and Write tools work normally.
## Acceptance Criteria
- [ ] Permission hook returns valid responses for Edit and Write tool calls
- [ ] Editing files in the project root (e.g. README.md) works without hook errors