MoonshotAI / MoonshotAI/kimi-code

Web: media preview panel shows "0 B" for uploaded image attachments

Open
#2,260 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

Bug

In the web UI, clicking an image attachment in a user message opens the preview panel with 0 B as the file size, and the fallback title is "ReadMediaFile image" even though the media is a user upload, not a tool result.

Root cause

ChatPane.userAttachmentMedia() builds the ToolMedia for the preview with no bytes field (a TurnAttachment for image/video carries no size). In v2 sessions the image is rehydrated from the agent blob store as a bare data: URL with no size metadata either, so openMediaPreview falls back to size: 0 (useFilePreview.ts) and the header renders "0 B". The same fallback produces the misleading "ReadMediaFile image" label when the media has no path.

Expected

The preview header shows the real byte size, and a generic Image/Video label for unnamed uploads.

Where

  • apps/kimi-web/src/components/chat/ChatPane.vue (userAttachmentMedia)
  • apps/kimi-web/src/composables/useFilePreview.ts (openMediaPreview)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read userAttachmentMedia in apps/kimi-web/src/components/chat/ChatPane.vue and openMediaPreview in apps/kimi-web/src/composables/useFilePreview.ts, then trace the image and video attachment data for both regular and v2 sessions. Verify the preview header reports the uploaded byte size and uses generic Image/Video labels when no path is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.