Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/agent-core/src/tools/builtin/file/read-media.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Read media content from a file.
- This tool can only read image or video files. To read text files, use the Read tool. To list directories, use `ls` via Bash for a known directory, or Glob for pattern search.
- If the file doesn't exist or path is invalid, an error will be returned.
- The maximum size that can be read is {{ MAX_MEDIA_MEGABYTES }}MB. An error will be returned if the file is larger than this limit.
- The media content will be returned in a form that you can directly view and understand.
- When analyzing video files, prefer using ReadMediaFile directly rather than writing Python scripts to extract frames. The model can directly view and understand the video content returned by this tool.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict video-only guidance to video-capable models

When the current model has image_in but not video_in (a supported configuration in the capability registry and covered by the read-media tests), ReadMediaFile is still exposed for images, but ReadMediaFileTool.execution rejects video files with “current model does not support video input.” This new unconditional guidance tells the model not to extract frames and to use ReadMediaFile instead, so local video-analysis requests on image-only models are steered into a tool call that must fail instead of the existing frame-extraction fallback. Please make this guidance conditional on video_in or mention the fallback when videos are unsupported.

Useful? React with 👍 / 👎.


**Capabilities**
2 changes: 1 addition & 1 deletion packages/agent-core/src/tools/builtin/file/read.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ When you need several files, prefer to read them in parallel: emit multiple `Rea
- Returns up to {{ MAX_LINES }} lines or {{ MAX_BYTES_KB }} KB per call, whichever comes first; lines longer than {{ MAX_LINE_LENGTH }} chars are truncated mid-line.
- Page larger files with `line_offset` (1-based start line) and `n_lines`. Omit `n_lines` to read up to the {{ MAX_LINES }}-line cap.
- Sensitive files (`.env` files, credential stores, SSH keys, and similar secrets) are refused to protect secrets; do not attempt to read them.
- Only UTF-8 text files can be read. Non-UTF-8 encodings, binary files, and files containing NUL bytes are refused; use `ReadMediaFile` for images or video, and Bash or an MCP tool for other binary formats.
- Only UTF-8 text files can be read. Non-UTF-8 encodings, binary files, and files containing NUL bytes are refused; use `ReadMediaFile` for images or video, and Bash or an MCP tool for other binary formats. Do not use Python scripts to extract frames from video files — use `ReadMediaFile` instead.
- Negative line_offset reads from the end of the file (for example, -100 reads the last 100 lines); the absolute value cannot exceed {{ MAX_LINES }}.
- Output format: `<line-number>\t<content>` per line.
- A `<system>...</system>` status block is appended after the file content; it summarizes how much was read (line and byte counts, truncation, line-ending notes) and is not part of the file itself.
Expand Down
Loading