Skip to content

feat: prompt AI to use ReadMediaFile for video attachments instead of Python frame extraction#627

Open
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:feat/readmediafile-video-prompt
Open

feat: prompt AI to use ReadMediaFile for video attachments instead of Python frame extraction#627
bj456736 wants to merge 1 commit into
MoonshotAI:mainfrom
bj456736:feat/readmediafile-video-prompt

Conversation

@bj456736

Copy link
Copy Markdown
Contributor

Problem

When users upload videos as attachments, the system renders them as <video path="..."> tags in the prompt. Previously, the system prompt only provided general guidance about "use proper tools or shell commands or Python packages to process... multimedia files", which often led the AI to write Python scripts to extract frames manually instead of using the built-in ReadMediaFile tool.

This was reported as feedback Q-0266: Kimi CLI 视频分析希望默认调用 ReadMediaFile 而不是写 Python 切帧.

Solution

Added an explicit instruction in the default system prompt (packages/agent-core/src/profile/default/system.md):

When the user uploads a video as an attachment (represented as <video path="..."> in the message), you should use the ReadMediaFile tool to read the video content directly instead of writing Python scripts to extract frames or process it manually.

Why this approach

  • Minimal change: Single-line addition to existing system prompt, no code changes needed.
  • Leverages existing infrastructure: ReadMediaFile already fully supports video files via the video_in capability and videoUploader.
  • Aligns with user intent: The feedback specifically requested that video analysis default to ReadMediaFile rather than Python frame extraction.
  • No tests affected: Existing tests for prompt rendering and profile loading continue to pass.

@changeset-bot

changeset-bot Bot commented Jun 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: af2a321

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 10, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@af2a321
npx https://pkg.pr.new/@moonshot-ai/kimi-code@af2a321

commit: af2a321

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.

1 participant