Repository navigation
Fix OpenRouter MAI-Voice speech playback - #16463
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…#16464) ## Summary `Parity verdict, scored against the null` fails on unrelated PRs whose base includes #16300 (`d56738f404`, the turn navigator at the chat's left edge). In the last two hours it failed on #16458 (a backend-only change) and on staging for #16463 and #16435, each time the same way: ``` matched: 0 unstable actions differing: 32 (expected to vary; not a verdict) NOTHING WAS COMPARED. ... This is not a pass. ``` In the null control (the same build on both arms), every action's thread scaffold digest differs, even between two repetitions on the same arm, while its length stays equal (`thread scaffolding outside any message (24167->24167c)`). That is an instance id leaking into the structural signature. #16300 renders the navigator inside the thread root, outside every message, as one button per turn with `data-turn-id={openerId}`. `openerId` is the turn's opening message id (`thread-turns.ts` pushes `message.id`). `scene/parity.js` already drops the values of `data-message-id`, `data-thread-id` and the other id attributes it knew about, but not this new one. Studio's message ids are short and random, so `ID_RE` does not catch them in the value either. The product is fine; the instrument fell behind the DOM. ## Change - **`tests/studio/studiobench/scene/parity.js`:** an attribute is volatile if it is in `VOLATILE_ATTRS`, or if its name matches `data-*-id`. A volatile attribute keeps its presence in the signature and loses only its value, as before. - Every `data-*-id` in the frontend names an instance, e.g. `data-turn-id`, `data-queue-item-id`, `data-bookmark-id`, `data-entry-id`. - So the next one added inside the thread cannot silently empty the verdict the way this one did. - Non-id data attributes (`data-turn`, `data-role`, `data-state`, ...) still compare by value. - **`tests/studio/studiobench/fixture/selftest/test_studiobench_parity_digest.py`** (these run the shipped `parity.js` under node): - `test_every_data_id_attribute_is_volatile`: two different `data-turn-id` values sign the same, a button with the attribute still differs from one without it, and the same holds for `data-queue-item-id`. - `test_a_data_attribute_that_is_not_an_id_still_moves_the_signature`: `data-turn="1"` against `"2"` still differs. ## Testing - `tests/studio/studiobench/fixture/selftest`, `sweep/selftest` and `analysis/selftest`: 606 passed. - Sabotage: with main's `parity.js`, `test_every_data_id_attribute_is_volatile` fails; the other new test passes on both. - Not proven here: I did not rerun the full parity sweep locally. The PR's own parity job is the end-to-end check. On main's harness it should report a non-zero `matched` count on this PR, as the runs before #16300 did (28 or 29).
Studio requests WAV for external speech, but OpenRouter's Microsoft MAI-Voice models accept only MP3 or PCM. Preview and read-aloud therefore fail with HTTP 400. Request PCM for this provider/model family when WAV is requested, then wrap the unchanged 24 kHz mono 16-bit samples as WAV for Studio's existing playback and WAV-only backend consumers.
The adaptation is limited to OpenRouter MAI-Voice WAV requests. Explicit MP3/PCM requests and other providers/models retain their behavior. No UI controls, dependencies, model weights, or device routing change. This does not add OpenRouter models to the Audio workspace picker.
Validation at d9690f5:
Audio/PCM; the comparison now follows HTTP's case-insensitive media-type rules.Broader validation limits: the initial Studio switchboard reported functional NO_REGRESSION, with settings coverage gaps from an initially blank page and crawl visual differences outside the speech path. Its model journeys ran remotely on Colab T4 High-RAM. The broader staging parity job was inconclusive because its base-versus-base control marked all 32 action pairs unstable and compared zero stable pairs. These results are not being presented as complete UI parity. The final-head switchboard is CURRENT and reports functional NO_REGRESSION: 48 SAME, one FLAKY, one retained VISUAL_DIFF, one DOM_ONLY_DIFF; coverage 87.5% overall and 95.5% safe. The primary hub confirmation images are pixel-identical, while an extra image-viewer capture differs in its magenta mask bounds. Its visual classification is retained, so full visual parity remains unproven. The DOM-only Studio difference has zero changed pixels.
Live paid-provider synthesis, voice quality, and Windows Desktop audio playback have not been exercised. The fix covers the reported MAI-Voice family; generic format negotiation for other TTS providers/models remains separate work.
Fixes #16443
Settings > Voice preview, exact merge base versus d9690f5 in two isolated installs. Both use the reported model and German voice. A local HTTP fixture enforces OpenRouter's documented formats and returns a test tone: before, WAV is rejected with HTTP 400; after, PCM is returned as WAV and Chromium emits its native playing event, with Stop visible. This demonstrates Studio integration and playback, not live OpenRouter synthesis or voice quality.