[PR #886] [CLOSED] serve: skip completed empty assistant turns in chat history #2894

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/886
Author: @Arthur031221
Created: 10/5/2026
Status: ❌ Closed

Base: main ← Head: fix/empty-assistant-history


📝 Commits (1)

  • 1bb8ff9 serve: skip completed empty assistant turns in chat history

📊 Changes

2 files changed (+86 additions, -0 deletions)

View changed files

📝 serve/frontend.py (+5 -0)
➕ serve/test_frontend.py (+81 -0)

📄 Description

Clients that resend empty assistant replies can get completed turns with no answer or tool call in their next prompt. This skips those turns before rendering and keeps the final message, tool calls, and images.

Based on @jramirez-uab's patch in #843. Added a regression that checks rendered history through the server's prompt tokenization.

Tested with .venv/bin/python -m unittest serve.test_frontend -q.

Fixes #843

Co-authored-by: jramirez-uab 238218748+jramirez-uab@users.noreply.github.com


🔄 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/886 **Author:** [@Arthur031221](https://github.com/Arthur031221) **Created:** 10/5/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/empty-assistant-history` --- ### 📝 Commits (1) - [`1bb8ff9`](https://github.com/Niko1221/Strata/commit/1bb8ff91b63b388d5061b2f5eaa20b7da85beb82) serve: skip completed empty assistant turns in chat history ### 📊 Changes **2 files changed** (+86 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `serve/frontend.py` (+5 -0) ➕ `serve/test_frontend.py` (+81 -0) </details> ### 📄 Description Clients that resend empty assistant replies can get completed turns with no answer or tool call in their next prompt. This skips those turns before rendering and keeps the final message, tool calls, and images. Based on @jramirez-uab's patch in [#843](https://github.com/Niko1221/Strata/issues/843). Added a regression that checks rendered history through the server's prompt tokenization. Tested with `.venv/bin/python -m unittest serve.test_frontend -q`. Fixes #843 Co-authored-by: jramirez-uab <238218748+jramirez-uab@users.noreply.github.com> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:03:57 +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#2894
No description provided.