Issues / #976

#976 serve: structured-output failure path returns error: null instead of 502 structured_output_failed (test_responses)

closed · @AmjedMVP · 3 コメント · GitHub で見る

Setup & installServer & APILinux

本文

## Summary

`serve/test_responses.py::test_json_schema_text_format` errors on `main` (6f32ec0): the HTTP response's `error` field is `None` where the test expects an error object (502 / `structured_output_failed`), and the test then does `r["error"]["..."]` → `TypeError: 'NoneType' object is not subscriptable`.

## Environment

- Ubuntu 26.04 LTS (WSL2), x86_64, Python 3.14.4, fresh clone @ `6f32ec0`, `.venv` + requirements installed
- No GPU involved — MockEngine-based

## Reproduce

```sh
python3 -m unittest serve/test_responses.py -v
```

```
ERROR: test_json_schema_text_format (__main__.OverHttp.test_json_schema_text_format)
TypeError: 'NoneType' object is not subscriptable
```

`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": null` instead of the expected 502 `structured_output_failed` error object. So beyond the test error itself, there is likely a real API-contract issue: clients checking `resp["error"]` can't detect a failed JSON-schema generation. The other `test_responses` cases pass, so this is specific to the json-schema text-format path.

関連リンク

インストール・モデル・リリースへの站内リンク。