mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2467] [Bug]: json_object silently discards elements from array-root output #1007
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#1007
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 @bettercallcaleb on GitHub (Oct 14, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2467
What happened
With
response_format: {"type":"json_object"}, an array-root model response can be accepted as a successful JSON object._extract_json()selects the first balanced{...}inside the array and drops the remaining elements.Reproduced on unmodified
main(296b59d):Actual:
{"answer":1}. The mock HTTP endpoint also returned 200 with that truncated object.Expected: reject an array-root response with
structured_output_failed(HTTP 502 for non-streaming requests), not silently reinterpret it as an object. Existing support for an object inside prose or a Markdown code fence (#762) should remain intact.Strata version, GPU, OS
mainat296b59d· Ubuntu 24.04 LTS · Python 3.12 · GPU not used (parser-only and MockEngine HTTP reproduction).@qiuzan2001 commented on GitHub (Oct 15, 2026):
Reproduced on Linux with main
296b59d2:serve.structured.validated_json('[{"answer":1},{"answer":2}]', _ObjectOnly(), 'stop')returns'{"answer":1}', the second element silently dropped. On open PR #2469 the same call raisesStructuredOutputError ... the answer is not a JSON object, an object after prose ('Here: {"answer":1}') is still extracted, andserve/test_structured.pypasses.@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. 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.