mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4446] [GUI] /v1 requests over 12 MiB get a 500, and the App Host's limit is hard-coded, so the engine's STRATA_MAX_BODY_MIB never applies #1986
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#1986
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?
Originally created by @kiwigloballimited-hub on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4446
Area: [GUI] (the App Host gateway that serves the OpenAI-compatible API)
Desktop app, Terminal or source? Desktop app (Windows; the client is a Mac on the network)
What happened
Two things in
apps/host/server/:The limit is hard-coded and lower than the engine's.
index.mjs:2052reads everyPOST /v1/chat/completions,/v1/messagesand/v1/responsesbody withreadBody(req, 12 * 1024 * 1024). The same 12 MiB appears at:1774and:1981for the/api/chat/*routes. Nothing configures it. Meanwhileserve/server.py:6495body_limit()defaults to 256 MiB and honours
STRATA_MAX_BODY_MIB— but that code is only reached after thegateway has forwarded the body, so through the app the effective limit is always the smaller
12 MiB and the documented knob does nothing. The same applies to the 4 MiB default in
util.mjs:27for every other route that callsreadBody(req).Going over it is reported as a 500.
readBody(util.mjs:27-42) throws a plainnew Error('Request body too large'), with no status or code, and the top-level catch inindex.mjs:986-987maps every thrown error toerror(res, 500, err.message). So a request thatis merely too large comes back as
HTTP 500 {"error":"Request body too large"}.index.mjs:1755already maps
e.code === 'too-big'to 413 for another route, andserve/server.pyanswers thissame condition with 413 before reading the body — this path is the outlier, not the rule.
Smallest steps that reproduce it
Observed:
HTTP 500with{"error":"Request body too large"}; the body is refused before it isforwarded, so nothing about the request reaches the engine. Expected: either the request is accepted
up to the engine's limit, or it is refused with
413and a message that names the limit.Why it matters beyond one report
An agent client that sends a photo or two per turn (Hermes here, but any OpenAI-compatible agent)
resends the conversation every turn: a 3–5 MB JPEG is 4–7 MB once base64-encoded, so the second or
third turn crosses 12 MiB and every later request fails the same way. A 500 reads as a server fault,
so the client retries the identical oversized body or reports the model as broken, and the picture
feature appears to die mid-conversation while the engine is healthy.
Suggested fix, two parts
STRATA_MAX_BODY_MIB(the name the engine alreadyuses) at the
/v1call site and asreadBody's default, falling back to the engine's 256 MiB, soone variable controls the whole path. Exposing it in Serving settings would be the nicer version.
readBodyseterr.status = 413(orerr.code = 'too-big', which:1755already understands) and have the catch-all use
err.status ?? 500. Rejecting onContent-Lengthbefore reading, as
serve/server.pydoes, would also avoid buffering an oversized body into RAMfirst.
Environment
0.2.7desktop app on Windows — code inspected at tagv0.2.7POST /v1/chat/completionsover the networkreaches the engine, so the GPU and RAM do not enter into this one)
Reproduction status: reproduced locally by the reporter (Windows app, agent client on a Mac,
1–2 large images per turn); the line references above were checked against
v0.2.7.@Niko1221 commented on GitHub (Nov 5, 2026):
Thanks for taking the time to report this.
Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.