[PR #113] [MERGED] serve: keep image parts in tool/assistant messages #2465

Closed
opened 2026-11-04 02:00:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/113
Author: @Yunado
Created: 9/29/2026
Status: ✅ Merged
Merged: 9/29/2026
Merged by: @Niko1221

Base: main ← Head: fix/serve-tool-images


📝 Commits (1)

  • cb91f2a serve: keep image parts in tool/assistant messages

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 serve/frontend.py (+1 -1)

📄 Description

openai_to_messages() flattened every non-user message to text, so agent clients that return screenshots as tool results (CUA-style loops) run blind: the model never sees the image.

The chat template renders image items in any non-system message fine (render_content is applied to user/assistant/tool alike), and images_of counts them from the same normalized messages, so only this conversion was too strict.

_parts_of passes plain string content through unchanged, so text-only traffic is untouched.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/113 **Author:** [@Yunado](https://github.com/Yunado) **Created:** 9/29/2026 **Status:** ✅ Merged **Merged:** 9/29/2026 **Merged by:** [@Niko1221](https://github.com/Niko1221) **Base:** `main` ← **Head:** `fix/serve-tool-images` --- ### 📝 Commits (1) - [`cb91f2a`](https://github.com/Niko1221/Strata/commit/cb91f2ad5039a27c4bf775d9bfe6ddfdb98bd5c1) serve: keep image parts in tool/assistant messages ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `serve/frontend.py` (+1 -1) </details> ### 📄 Description `openai_to_messages()` flattened every non-user message to text, so agent clients that return screenshots as tool results (CUA-style loops) run blind: the model never sees the image. The chat template renders image items in any non-system message fine (`render_content` is applied to user/assistant/tool alike), and `images_of` counts them from the same normalized messages, so only this conversion was too strict. `_parts_of` passes plain string content through unchanged, so text-only traffic is untouched. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:00:24 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2465
No description provided.