Skip to content

feat(chat): tell the agent where the images sent are, as files - #1288

Merged
leookun merged 1 commit into
mainfrom
feat/image-paths-for-agent
Nov 24, 2026
Merged

leookun merged 1 commit into
mainfrom
feat/image-paths-for-agent

Conversation

@leookun

@leookun leookun commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes #1129

Images were sent only as base64 blocks, so an agent asked to upload or attach "this image" had to guess a file on disk.

  • PasteStore.saveImage keeps the bytes as sent (after BaoCode's resize/JPEG pass, i.e. exactly what the model saw) in <data>/pastes/images/<sha256>.<ext>. That folder is under the pastes folder Claude Code is already allowed to read (ClaudeLaunch.readable).
  • ChatSession.send adds a hidden <system-reminder> listing [Image #N]: <path> for each image. Skipped for remote (SSH) projects.

Tests: new test/chat/image_files_note_test.dart; paste_store_test, image_references_test, reply_suggestions_test, kernel_test, bots tests pass.

🤖 Generated with BaoCode

Images reached the agent as pictures alone: asked to upload or attach one,
it searched the disk for a file like it, and could not be sure it had the
one sent. Each image sent is now kept beside the long pastes
(`<data>/pastes/images/`, which the agent may read already), and a note
with the message names each one's file ([Image #N]: path). Not for a
remote project's agent, which cannot read this machine's files.

Fixes #1129

Co-Authored-By: BaoCode <noreply@baocode.dev>
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.

[Feature] 图片输入应提供可访问的文件路径,当前 agent 无法定位图片导致附件上传失败

2 participants