[PR #4311] [GUI] Preserve image messages in provider chat history #4998

Open
opened 2026-11-07 16:31:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4311
Author: @szl0834
Created: 10/27/2026
Status: 🔄 Open

Base: main ← Head: fix/gui-image-history


📝 Commits (1)

  • 3490923 [GUI] Preserve image messages in provider chat history

📊 Changes

2 files changed (+135 additions, -1 deletions)

View changed files

📝 apps/host/server/model-providers.mjs (+29 -1)
➕ apps/host/tests/model-providers-history-images.test.mjs (+106 -0)

📄 Description

When the app replays an earlier picture as OpenAI content blocks, the provider host currently drops the entire history message because it only accepts string content. A follow-up question therefore loses both the earlier question and its picture, even if no new image is attached.

This preserves supported user text/image blocks for OpenAI chat connections and validates historical pictures with the existing PNG/JPEG/WebP validator. Text-only models and other protocols retain the historical text; plain string history keeps its content and last-40-message behavior. Image size and combined history/current picture limits remain bounded.

Reproduction: run the new UI-format image-history regression against upstream 4b9e05a2a806a3fe24f7b2560d98626c37dade35; it fails because the earlier image message is absent from the provider request. With this change, the same history is forwarded through repeated model selections.

Validation on Ubuntu x86_64, Node v24.22.1:

  • Passed: node --check apps/host/server/model-providers.mjs and node --check apps/host/tests/model-providers-history-images.test.mjs.
  • Passed: node --test apps/host/tests/model-providers-history-images.test.mjs apps/host/tests/model-providers.test.mjs apps/host/tests/vision-probe.test.mjs apps/host/tests/image-models.test.mjs — 31 passed, 0 failed, 0 skipped, including 12 new history regressions.
  • Passed: git diff 4b9e05a2a806a3fe24f7b2560d98626c37dade35 HEAD --check.
  • Expected failing control: the new UI-format history test against the unmodified upstream provider module exits 1 with a missing-history assertion. Restoring the fix returns the 31-test run to passing.
  • Not run for this standalone revision: the complete host suite, browser end-to-end tests, or a fresh live-model session. Provider responses in these regressions are stubbed; they verify request payloads and stream handling, not model image understanding.

Prepared with Codex. This PR contains only the provider-history fix and its tests; no native engine, model-router, dependency or deployment configuration changes.


🔄 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/4311 **Author:** [@szl0834](https://github.com/szl0834) **Created:** 10/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/gui-image-history` --- ### 📝 Commits (1) - [`3490923`](https://github.com/Niko1221/Strata/commit/3490923c5906727254869a93cd56769116706193) [GUI] Preserve image messages in provider chat history ### 📊 Changes **2 files changed** (+135 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `apps/host/server/model-providers.mjs` (+29 -1) ➕ `apps/host/tests/model-providers-history-images.test.mjs` (+106 -0) </details> ### 📄 Description When the app replays an earlier picture as OpenAI content blocks, the provider host currently drops the entire history message because it only accepts string content. A follow-up question therefore loses both the earlier question and its picture, even if no new image is attached. This preserves supported user text/image blocks for OpenAI chat connections and validates historical pictures with the existing PNG/JPEG/WebP validator. Text-only models and other protocols retain the historical text; plain string history keeps its content and last-40-message behavior. Image size and combined history/current picture limits remain bounded. Reproduction: run the new UI-format image-history regression against upstream `4b9e05a2a806a3fe24f7b2560d98626c37dade35`; it fails because the earlier image message is absent from the provider request. With this change, the same history is forwarded through repeated model selections. Validation on Ubuntu x86_64, Node v24.22.1: - Passed: `node --check apps/host/server/model-providers.mjs` and `node --check apps/host/tests/model-providers-history-images.test.mjs`. - Passed: `node --test apps/host/tests/model-providers-history-images.test.mjs apps/host/tests/model-providers.test.mjs apps/host/tests/vision-probe.test.mjs apps/host/tests/image-models.test.mjs` — 31 passed, 0 failed, 0 skipped, including 12 new history regressions. - Passed: `git diff 4b9e05a2a806a3fe24f7b2560d98626c37dade35 HEAD --check`. - Expected failing control: the new UI-format history test against the unmodified upstream provider module exits 1 with a missing-history assertion. Restoring the fix returns the 31-test run to passing. - Not run for this standalone revision: the complete host suite, browser end-to-end tests, or a fresh live-model session. Provider responses in these regressions are stubbed; they verify request payloads and stream handling, not model image understanding. Prepared with Codex. This PR contains only the provider-history fix and its tests; no native engine, model-router, dependency or deployment configuration changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#4998
No description provided.