mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4311] [GUI] Preserve image messages in provider chat history #4998
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4998
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
node --check apps/host/server/model-providers.mjsandnode --check apps/host/tests/model-providers-history-images.test.mjs.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.git diff 4b9e05a2a806a3fe24f7b2560d98626c37dade35 HEAD --check.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.