-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
MEDIA: token parser rejects Windows drive-letter paths #30973
Copy link
Copy link
Open
Description
Description
The isValidMedia() function in src/media/parse.ts (compiled: dist/media/parse.js) only accepts paths starting with /, ./, ../, ~, or http(s)://. On Windows, paths like C:\Users\... or C:/Users/... are rejected, making it impossible for CLI backends (like claude-cli) to send media back via MEDIA: tokens.
Current behavior
// Windows paths fall through to `return false`
function isValidMedia(candidate, opts) {
if (/^https?:\/\//i.test(candidate)) return true;
if (candidate.startsWith("/")) return true;
if (candidate.startsWith("./")) return true;
if (candidate.startsWith("../")) return true;
if (candidate.startsWith("~")) return true;
return false;
}When a CLI backend on Windows outputs MEDIA:C:\Users\path\to\image.jpg, the parser silently drops the token and no media is sent.
Expected behavior
Windows absolute paths (e.g. C:\..., D:/...) should be recognized as valid media paths.
Suggested fix
Add a check for Windows drive-letter paths:
// Match drive letters like C:\ or C:/
if (/^[a-zA-Z]:[/\]/.test(candidate)) return true;Environment
- Windows 11
- Clawdbot 2026.1.24-3
- Backend: Claude Code CLI (
claude-cli/sonnet) - Discord channel
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.