fix(tts): don't send default speed to non-OpenAI services and accept JSON base64 audio #468
All Vouch review confidence checks passed
Residual risk 0.23 = Change Risk (0.41) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.41 · 188 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.314
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #468"
general
weight: 0.35
pcbeingused333
Fixes #463
Root cause:
OpenAiAPIService::requestSpeechCreation()always addsspeedto the/audio/speechpayload and returns the response as parsed. Strict OpenAI-compatible APIs such as Mistral reject unknown body fields (422extra_forbiddenonspeed), and they answer with JSON{"audio_data": "<base64>"}instead of binary audio, whichTextToSpeechProviderreports as "no speech returned" because it only looks forbody.Fix:
speedis always sent to OpenAI; for other services it is only sent when it differs from the default1, so a custom speed still works for LocalAI-style servers that support it.audio_datais base64-decoded and returned in the samebody/content-typeshape as a binary response (binary responses are untouched).Tests: new
tests/unit/Service/OpenAiAPIServiceSpeechTest.php(5 tests) mocksrequest()and checks the payload and the response shape. 2 of them fail on main and all 5 pass with the change (plain PHPUnit 10.5 on PHP 8.4 with nextcloud/ocp; the existingOpenAiProviderTestneeds a full server and was not run).The existing
MultiServiceTest::testTextToSpeechProvider(non-OpenAI service) expected'speed' => 1in the request body; that expectation was updated (the field is no longer sent). It needs a full Nextcloud server, so it was not run locally.AI disclosure: this change was prepared with the assistance of an AI coding agent (Claude); the commit carries an
Assisted-bytrailer.