mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #976] serve: structured-output failure path returns error: null instead of 502 structured_output_failed (test_responses) #429
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#429
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 @AmjedMVP on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/976
Summary
serve/test_responses.py::test_json_schema_text_formaterrors onmain(6f32ec0): the HTTP response'serrorfield isNonewhere the test expects an error object (502 /structured_output_failed), and the test then doesr["error"]["..."]→TypeError: 'NoneType' object is not subscriptable.Environment
6f32ec0,.venv+ requirements installedReproduce
Ran 19 tests ... FAILED (errors=1); the other 18 pass.Interpretation
On the structured-output-failure path the server appears to return a 200-shaped body with
"error": nullinstead of the expected 502structured_output_failederror object. So beyond the test error itself, there is likely a real API-contract issue: clients checkingresp["error"]can't detect a failed JSON-schema generation. The othertest_responsescases pass, so this is specific to the json-schema text-format path.@talisp commented on GitHub (Oct 5, 2026):
Same here on
6f32ec0(Ubuntu 22.04, Python 3.10 venv). The cause is thatjsonschemais not installed: the server then cannot validate the output, so the 502structured_output_failedpath never runs, and the response haserror: null. The other jsonschema tests in the suite are skipped in that case; this one has no skip guard.#785 ("test_json_schema_text_format's schema failure only where jsonschema is installed") addressed exactly this, but it was closed without being merged.
@Niko1221 commented on GitHub (Oct 6, 2026):
Already fixed on main after 0.1.39 (#785): the test checks the schema failure only where
jsonschemais installed. Without it the server cannot validate the output, so the 502 path does not run, as you found.pip install jsonschemaruns the full test.@AmjedMVP commented on GitHub (Oct 6, 2026):
Confirmed fixed — reran
serve/test_responses.pyon82f46a8(WSL2 Ubuntu 26.04, Python 3.14.4, no jsonschema in the venv): all 19 tests OK, the unguarded case now skips like its siblings. Thanks. (We didn't re-verify the with-jsonschema 502 path itself — that runs only withpip install jsonschema.)