Skip to content

Attach video files the same way as images - #967

Merged
mpfaffenberger merged 1 commit into
mainfrom
cursor/video-file-attachments-af7c
Sep 25, 2026
Merged

mpfaffenberger merged 1 commit into
mainfrom
cursor/video-file-attachments-af7c

Conversation

@mpfaffenberger

Copy link
Copy Markdown
Owner

Summary

Prompt attachments now accept short local videos the same way they accept images (@path, drag-and-drop, and path tokens). Remote http(s) links whose path ends in a supported container are sent as pydantic-ai VideoUrl parts. Clipboard paste stays image-only.

Videos are BinaryContent with an explicit video/* media type. They never go through normalize_image_bytes / PIL.

Supported containers

Extension Media type
.mp4, .m4v video/mp4
.mov, .qt video/quicktime
.webm video/webm
.mkv video/x-matroska
.avi video/x-msvideo
.mpeg, .mpg video/mpeg
.wmv video/x-ms-wmv
.flv video/x-flv
.3gp, .3gpp video/3gpp

MIME types are fixed in code so they do not depend on the host mime database. .ts is not included because it collides with TypeScript sources.

URL attachments

pydantic-ai 2.47 has VideoUrl. An http/https URL is attached only when the URL path ends in one of the extensions above (query strings are fine; quote the URL if it contains a # fragment, because the existing shell tokenizer treats # as a comment).

Image and document URLs stay plain text, matching the previous behavior. YouTube and other page links are not auto-attached: they have no container suffix, and this change does not download remote video.

Provider caveats

Attachment plumbing stops at pydantic-ai parts. Models that cannot take video will still receive the bytes or URL and may error upstream.

In pydantic-ai 2.47:

  • OpenRouter maps video BinaryContent to a video_url data URI and VideoUrl to a video_url part. That is the path for OpenRouter models with native video input (for example MiniMax M3).
  • OpenAI Chat Completions and OpenAI Responses raise NotImplementedError for video BinaryContent and VideoUrl.
  • Anthropic raises NotImplementedError for video binary content and VideoUrl.

There is no transcode step and no size cap on video attachments. The file bytes are sent as-is.

Tests

tests/test_command_line_attachments.py, tests/command_line/test_attachments.py, and tests/messaging/test_editor_display.py cover accepted extensions, MIME types, the image-normalization bypass, VideoUrl links, and display tags. Existing image attachment tests still pass (134 tests in those files).

Open in Web Open in Cursor 

Accept standard video containers in prompts and send them as
BinaryContent with video/* media types, skipping image normalization.
http(s) links whose path ends in one of those containers become
pydantic-ai VideoUrl parts.

Co-authored-by: Mike Pfaffenberger <mike.pfaffenberger@gmail.com>
@mpfaffenberger
mpfaffenberger marked this pull request as ready for review September 25, 2026 19:48
@mpfaffenberger
mpfaffenberger merged commit 24547d1 into main Sep 25, 2026
3 checks passed
@mpfaffenberger
mpfaffenberger deleted the cursor/video-file-attachments-af7c branch September 25, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants