Repository navigation
fix(types): preserve realtime error messages - #3906
nanookclaw wants to merge 1 commit into
Conversation
|
AI-assisted offline comparison of head One useful distinction for the description/tests: in this environment the parent already preserves a supplied
A small discriminator for the typed-model fix would be asserting that Minimal parent-preservation check: status = parse_obj(RealtimeResponseStatus, {"error": {"message": "fictional error"}})
assert status.error.message == "fictional error"
assert status.model_dump()["error"]["message"] == "fictional error"All inputs were fictional and execution was network-denied. This is a pinned model-level comparison on Pydantic v2, not a live WebSocket test, a Pydantic v1 result, or full-suite coverage. |
Fixes #2502
The Realtime API can return a human-readable
status_details.error.message, but both stable and betaRealtimeResponseStatus.Errormodels currently drop it during validation.This change:
messagefield to both generated model variants;api_reference/openapi.transformed.yml;The change is limited to the generated schema/model surface and does not alter request or response handling.
Validation:
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 uvx --from uv==0.12.1 uv run --locked --all-extras python -m pytest -p pytest_asyncio.plugin -o addopts= tests/test_realtime_response_status.py -q— 2 passedruff checkon changed Python files — passedruff format --checkon changed Python files — passedpython3 -m py_compileon changed Python/test files — passedgit diff --check— passed