Repository navigation
fix(openai-tts)!: prefer params url over top-level url - #2402
Conversation
|
[P2] Cover exact audio-end accounting across terminal paths The new transport test stops at client response events, and the existing local suite checks audio duration only on flush with a 10 ms tolerance; it never asserts [P2] Exercise interrupted HTTP streams and recovery The added mock transport always returns a complete, successful body. The local suite does not cover a stream error after partial audio, cancellation while waiting for the first byte, or PCM samples split across HTTP chunks; the existing recovery test fails before the response begins. These cases can leave a request unfinished, emit stale audio, or lose samples without a failing test. Add controlled streaming responses for these cases and assert response closure, emitted bytes and terminal events, plus a successful following request. [P2] Measure TTFB independently at the HTTP boundary The registered OpenAI guarder hook wraps |
BREAKING CHANGE: params.url now takes precedence over the top-level url.
|
[P2] Cover non-audio HTTP responses and transient service errors The new transport test exercises only a 200 response with PCM, while the existing local error tests cover a 401 and a connection failure. There is no extension-level coverage for an empty response, a 200 response with an unexpected content type, or a 429/5xx response. In particular, the client currently streams any 200 body as PCM without checking its content type, so a proxy's HTML error page can reach the audio output without a test failing. Add deterministic HTTP response tests that assert no non-audio bytes are emitted, transient errors are reported correctly, and a subsequent request succeeds. This is part of the required local HTTP test matrix for touched TTS extensions. |
|
[P2] Cover appended and interleaved request input The new transport test calls the client with one complete text, and the existing state-machine test sends two separate inputs that are each already final. No local test appends text to an existing request or interleaves segments from different request IDs. A regression that finalizes on the first segment, loses the later text, or associates audio and terminal events with the wrong request would therefore pass the required TTS lifecycle gate. Add an extension-level test with non-final and final segments for interleaved request IDs, asserting the synthesized text, audio ownership, and one correctly ordered terminal event per request. |
When both
params.urland a top-levelurlare configured, OpenAI TTS currently sends requests to the top-level address. Prefer a nonblank string inparams.url, then fall back to top-levelurl,params.base_urlplus/audio/speech, and the default OpenAI endpoint.Preserve the existing fallback for missing, empty, whitespace-only, and non-string
params.urlvalues. Update the endpoint documentation and add HTTP transport tests that verify the selected POST URL, PCM response, authentication, and removal of endpoint-only parameters from the request body.Bump the extension version from
0.6.10to0.7.0in bothmanifest.jsonandpyproject.toml. This is a breaking configuration change: when both URLs are set andparams.urlis a nonblank string, requests now useparams.url. Deployments that relied on the top-level URL taking precedence must update their configuration before upgrading.Declare the direct runtime imports (
certifi,httpcore,httpx, andpydantic), enable the HTTP/2 extra required by the client, and add the test imports as an optionaltestdependency group.Validation:
task check: 1,716 Python files pass.