[PR #1664] [CLOSED] serve: a content part the server does not read is a 400 on chat and messages, as on responses #3593

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

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1664
Author: @midagedev
Created: 10/9/2026
Status: ❌ Closed

Base: main ← Head: unread-content-parts


📝 Commits (1)

  • 8b1f2d5 serve: a content part the server does not read is a 400 on chat and messages, as on responses

📊 Changes

2 files changed (+151 additions, -9 deletions)

View changed files

📝 serve/frontend.py (+50 -9)
📝 serve/test_frontend.py (+101 -0)

📄 Description

Summary

On /v1/chat/completions a file or input_audio part, and on /v1/messages a document block (also inside a tool_result), were dropped without a word. The request got a 200 and the model answered about a file it never saw. /v1/responses already refuses the same input; chat and messages now give the same 400, naming where the part is.

What changed

  • serve/frontend.py: _check_parts runs while a request is converted, e.g. messages[2].content[1].type: content parts of type 'document' are not supported (text and images are). Text, images, thinking, tool_use and tool_result read as before. redacted_thinking is still dropped (another server's encrypted reasoning). A chat refusal part now reads as its text, as on /v1/responses.
  • serve/test_frontend.py: seven tests, one of them checking that text and image requests render the same prompt as before.

Extra Notes

  • The 6 new cases fail before the change. After it, test_frontend, test_server, test_responses and test_request_hardening pass (macOS, Python 3.14).
  • If you prefer to keep dropping some types, I can do that with a printed warning instead.
  • I used Claude Code to find this and draft the change. I ran the tests myself.

🔄 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/1664 **Author:** [@midagedev](https://github.com/midagedev) **Created:** 10/9/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `unread-content-parts` --- ### 📝 Commits (1) - [`8b1f2d5`](https://github.com/Niko1221/Strata/commit/8b1f2d5afb60f7f8a6613edd0685977cd4b584d2) serve: a content part the server does not read is a 400 on chat and messages, as on responses ### 📊 Changes **2 files changed** (+151 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `serve/frontend.py` (+50 -9) 📝 `serve/test_frontend.py` (+101 -0) </details> ### 📄 Description ## Summary On `/v1/chat/completions` a `file` or `input_audio` part, and on `/v1/messages` a `document` block (also inside a `tool_result`), were dropped without a word. The request got a 200 and the model answered about a file it never saw. `/v1/responses` already refuses the same input; chat and messages now give the same 400, naming where the part is. ## What changed - `serve/frontend.py`: `_check_parts` runs while a request is converted, e.g. `messages[2].content[1].type: content parts of type 'document' are not supported (text and images are)`. Text, images, thinking, tool_use and tool_result read as before. `redacted_thinking` is still dropped (another server's encrypted reasoning). A chat `refusal` part now reads as its text, as on `/v1/responses`. - `serve/test_frontend.py`: seven tests, one of them checking that text and image requests render the same prompt as before. ## Extra Notes - The 6 new cases fail before the change. After it, test_frontend, test_server, test_responses and test_request_hardening pass (macOS, Python 3.14). - If you prefer to keep dropping some types, I can do that with a printed warning instead. - I used Claude Code to find this and draft the change. I ran the tests myself. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:29: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#3593
No description provided.