aws / aws/amazon-q-developer-cli

Q doesn't add images to conversation history

オープン
#2,256 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
2k
フォーク
439
PR マージ指標
30日以内にマージされた PR はありません

説明

### Checks

- [x] I have searched [github.com/aws/amazon-q-developer-cli/issues](https://github.com/aws/amazon-q-developer-cli/issues?q=) and there are no duplicates of my issue
- [x] I have run `q doctor` in the affected terminal session
- [x] I have run `q restart` and replicated the issue again

### Operating system

macOS 15.5.0 (24F74)

### Expected behaviour

When creating the [conversation history](https://github.com/aws/amazon-q-developer-cli/blob/a566a2a472bc75465ceec9ca08ec9e617725fbf6/crates/chat-cli/src/cli/chat/message.rs#L144) to send to the LLM, Q does not append images it has read before. As a result, asking follow up information about an image that has already been sent in a previous message causes it to hallucinate, as it has lost access to the actual data of the image.

For example, when asked to read the text the following image in one go, it works fine:

Image

```
> there is a screenshot on my desktop with some text, read it and tell me what the text is

> I'll help you read the text from the screenshot on your desktop. Let me first check what files are on your desktop, then read the screenshot.

🛠️ Using tool: fs_read (trusted)

● Reading directory: /Users/USER/Desktop with maximum depth of 0

● Completed in 0.0s

> I can see there's a screenshot file on your desktop. Let me read the text from it:

🛠️ Using tool: fs_read (trusted)

● Reading images:
/Users/USER/Desktop/Screenshot 2025-07-08 at 11.49.25 AM.png

● Completed in 0.0s

> I can see the text in your screenshot. It reads:

"This is some text. This is an unrelated sentence Q should know about."

The text appears to be displayed in white text on a dark background.
```

### Actual behaviour

When asked some follow up information for the same image, but not as part of the original message, the following happens:

```
> there is a screenshot on my desktop with some text, read it and tell me only what the first sentence is

> I'll help you read the screenshot on your desktop. Let me first check what files are available on your desktop, then read the screenshot.

🛠️ Using tool: fs_read (trusted)

● Reading directory: ~/Desktop with maximum depth of 0

● Completed in 0.0s

> I can see there's a screenshot file on your desktop. Let me read it to extract the text.

🛠️ Using tool: fs_read (trusted)

● Reading images:
/Users/USER/Desktop/Screenshot 2025-07-08 at 11.49.25 AM.png

● Completed in 0.0s

> The first sentence is: "This is some text."

> what's the next sentence?

> The next sentence is: "This is the second sentence with more information."
```

### Steps to reproduce

_No response_

### Environment

```yaml

[q-details]
version = "1.12.3"
hash = "65aa9285fc7ec3716215386a89d3a626500a25a7"
date = "2025-07-03T01:14:12.212107Z (6d ago)"
variant = "full"

[system-info]
os = "macOS 15.5.0 (24F74)"
chip = "Apple M3 Pro"
total-cores = 12
memory = "36.00 GB"

[environment]
cwd = "/Users/USER/mcp-attacks"
cli-path = "/Users/USER/mcp-attacks"
os = "Mac"
shell-path = "/bin/zsh"
shell-version = "5.9"
terminal = "iTerm 2"
install-method = "unknown"

[env-vars]
PATH = "/Users/USER/.nvm/versions/node/v24.0.2/bin:/Users/USER/.toolbox/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/USER/.nvm/versions/node/v24.0.2/bin:/Users/USER/.toolbox/bin:/Users/USER/.cargo/bin:/Applications/iTerm.app/Contents/Resources/utilities:/Users/USER/.local/bin:/opt/homebrew/bin:/Users/USER/.rvm/bin:/Users/USER/.local/bin:/opt/homebrew/bin:/Users/USER/.rvm/bin"
QTERM_SESSION_ID = "4146da80dc5e4e1783858de28e96de3b"
Q_SET_PARENT_CHECK = "1"
Q_TERM = "1.12.2"
SHELL = "/bin/zsh"
TERM = "tmux-256color"
__CFBundleIdentifier = "com.googlecode.iterm2"
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

crates/chat-cli/src/cli/chat/message.rs の、issue でリンクされている会話履歴コード付近から始め、以前に読み取った画像がどのように処理されるかを追跡します。レポートに記載されている 2 ターンのスクリーンショットの follow-up を再現し、その後、follow-up が以前の画像データへのアクセスを保持していることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
ai, cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。