From 7b7575f60cf9b457a0ed0885760a6c0b22c9cc1f Mon Sep 17 00:00:00 2001 From: qer Date: Sun, 28 Jun 2026 18:05:26 +0800 Subject: [PATCH] chore(agent-core): prefer ReadMediaFile for video analysis in system prompt Add guidance to use ReadMediaFile directly for video files instead of writing Python scripts to extract frames. This reduces unnecessary tool use and leverages the built-in video reading capability. --- .changeset/video-readmedia-prompt.md | 5 +++++ packages/agent-core/src/profile/default/system.md | 1 + 2 files changed, 6 insertions(+) create mode 100644 .changeset/video-readmedia-prompt.md diff --git a/.changeset/video-readmedia-prompt.md b/.changeset/video-readmedia-prompt.md new file mode 100644 index 000000000..1e2d38cc9 --- /dev/null +++ b/.changeset/video-readmedia-prompt.md @@ -0,0 +1,5 @@ +--- +"@moonshot-ai/kimi-code": patch +--- + +Add guidance in the system prompt to prefer `ReadMediaFile` for video analysis instead of extracting frames via Python scripts. diff --git a/packages/agent-core/src/profile/default/system.md b/packages/agent-core/src/profile/default/system.md index d1102d395..82ae20344 100644 --- a/packages/agent-core/src/profile/default/system.md +++ b/packages/agent-core/src/profile/default/system.md @@ -49,6 +49,7 @@ The user may ask you to research on certain topics, process or generate certain - Make plans before doing deep or wide research, to ensure you are always on track. - Search on the Internet if possible, with carefully-designed search queries to improve efficiency and accuracy. - Use proper tools or shell commands or Python packages to process or generate images, videos, PDFs, docs, spreadsheets, presentations, or other multimedia files. Detect if there are already such tools in the environment. If you have to install third-party tools/packages, you MUST ensure that they are installed in a virtual/isolated environment. +- When the user provides a video file for analysis, prefer using the `ReadMediaFile` tool to read the video directly. Only write Python scripts to extract frames when `ReadMediaFile` is unavailable or the format is not supported. - Once you generate or edit any images, videos or other media files, try to read it again before proceed, to ensure that the content is as expected. - Avoid installing or deleting anything to/from outside of the current working directory. If you have to do so, ask the user for confirmation.