Fix Unicode space handling in macOS screenshot filenames

macOS uses U+202F (Narrow No-Break Space) in screenshot filenames
between the time and am/pm. When users type or paste these paths,
they use regular spaces, causing file-not-found errors.

Changes:
- Add resolve_path_with_unicode_fallback() to try U+202F variants
- Add resolve_paths_in_shell_command() for shell command paths
- Apply fix to read_file, read_image, and shell tools
- Fix read_image prompt docs: file_path -> file_paths (array)
- Add 6 unit tests for Unicode space normalization
This commit is contained in:
Dhanji R. Prasanna
2026-01-03 17:17:08 +11:00
parent f7e2f38fe9
commit 29e263ac49
4 changed files with 181 additions and 5 deletions

View File

@@ -260,8 +260,8 @@ Short description for providers without native calling specs:
- Example (partial): {\"tool\": \"read_file\", \"args\": {\"file_path\": \"large.log\", \"start\": 0, \"end\": 1000}
- **read_image**: Read an image file for visual analysis (PNG, JPEG, GIF, WebP)
- Format: {\"tool\": \"read_image\", \"args\": {\"file_path\": \"path/to/image.png\"}}
- Example: {\"tool\": \"read_image\", \"args\": {\"file_path\": \"sprites/fairy.png\"}}
- Format: {\"tool\": \"read_image\", \"args\": {\"file_paths\": [\"path/to/image.png\"]}}
- Example: {\"tool\": \"read_image\", \"args\": {\"file_paths\": [\"sprites/fairy.png\"]}}
- **write_file**: Write content to a file (creates or overwrites)
- Format: {\"tool\": \"write_file\", \"args\": {\"file_path\": \"path/to/file\", \"content\": \"file content\"}