Repository navigation
Add configurable voice context to reduce Qwen3-ASR memory - #15810
Conversation
Codex Review Summary: ✅ CompletedThis 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. |
|
Adding them to every locale overlay ( |
`(Python 3.13, rest)` on #15810 failed `test_legacy_sandbox_is_migrated` with a log line that gives the cause away: ``` Moved 1 chat sandbox folder(s) from .../test_legacy_sandbox_is_migrate0/userprofile/studio_sandbox to .../test_sandbox_lives_under_the_s0/custom_studio_home/sandbox ``` The legacy folder of one test was moved into the sandbox root of the test that ran before it on the same xdist worker. ## Cause Since #15628, `get_sandbox_workdir` starts a background `sandbox-migrate` thread. That thread captures `sandbox_root()` when it starts, but reads the legacy root (`HOME/studio_sandbox`) only once it gets scheduled. `test_sandbox_lives_under_the_studio_home` never waits for its mover. On a busy worker the mover was still pending when `test_legacy_sandbox_is_migrated` switched `HOME` and reset `_legacy_sandbox_migrated`. It then moved the new test's folder into the old root. The new test's own `get_sandbox_workdir` found that mover still alive and reused it, so nothing ever moved the folder to where the test looks. The product is fine: in a real process `HOME` never changes under the mover. This is test isolation. There is a second hazard with the same root. The conftest does not isolate `HOME`, so a mover that outlives a test's `monkeypatch` reads the real `~/studio_sandbox`. ## Fix A conftest autouse fixture joins any live `sandbox-migrate` thread before and after every backend test. It raises if a mover does not finish in 30s instead of letting it leak. The fixture requests `monkeypatch`, so the drain runs before the test's `HOME` is restored and a late mover can never read the real home directory. ## Verification - Repro: a tiny plugin delays the mover by 1s, the way a loaded worker deschedules it. Running `test_sandbox_lives_under_the_studio_home` and then `test_legacy_sandbox_is_migrated`: - main `3db711acb5`: `1 failed, 1 passed`, with the same misplaced move as CI - this branch: `2 passed` - `test_sandbox_files_and_storage_roots.py` on its own: 321 passed. - The 10 backend test files that start a mover, under `-n 8`: 887 passed, 3 skipped. - Only `conftest.py` and `test_sandbox_files_and_storage_roots.py` drive the mover directly, and nothing holds one open across tests, so the drain cannot stall an unrelated test.
|
Fixed in 0e96760: all five Voice context strings are translated in all 13 locale overlays, preserving the The startup bundle still exceeded the updated budget by 319 bytes. A comparison against main with the same Node version and dependencies measured this feature's growth at 978 bytes raw / 474 bytes compressed, with 85 startup chunks unchanged. Commit 91cebe8 adjusts the budget by exactly that growth, preserving main's headroom. Locally verified |
# Conflicts: # studio/backend/tests/test_transcribe_source_route.py # studio/frontend/scripts/check-bundle-budget.ts
|
@codex review |
1 similar comment
|
@codex review |
|
Checked head e92df90. The Windows Composer failure appears to be a shared CI fixture problem: it times out waiting for Local validation on the pinned head: 294 targeted backend tests and 45 frontend tests passed, covering context sizing and limits, active-request safety, cancellation, missing-counter compatibility, request propagation, and explicit truncation errors. Safety and merge-aware worktree checks were clean. No product change was needed for this CI failure. A fresh Codex review is running. |
|
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". |
…gs store (#17293) ## Summary `main` is red in the frontend unit tests (`Frontend build + bundle sanity` and `Frontend unit tests (Windows)`) since #16976 merged: ``` # Error: no stub for import "./stt-context" in .../features/settings/stores/voice-settings-store.ts not ok 888 - tests/mic-target.test.ts ``` #15810 (merged at 15:43 UTC) moved the voice context settings into `stores/stt-context.ts` and made `voice-settings-store.ts` import it. #16976 (merged about an hour later) added `tests/mic-target.test.ts`, which loads that store through `loadWithStubs` with a stub list written before that import existed. `loadWithStubs` throws on any unstubbed import, so the whole file fails at load, and every PR based on current `main` inherits the red. #16976's own code is fine; only its test's stub list is out of date. The fix passes the real `stt-context` module, the same way `voice-settings-storage-sync.test.ts` already does after #15810. ## Changes - `studio/frontend/tests/mic-target.test.ts`: add `"./stt-context": sttContext` to the store's stubs. ## Testing - `node --test tests/mic-target.test.ts`: 20 passed. On `main` the same file fails to load (0 passed, 1 failed). - `npm test` (whole frontend unit suite): 15450 tests, 0 failed.
Qwen3-ASR currently lets llama-server allocate its full 64K context even for short recordings. Add a Voice context setting with Auto and fixed limits from 1K to 64K. In a local RTX 5070 Ti check with Qwen3-ASR-0.6B Q8_0, the same 11-second recording used roughly 8.7 GiB at 64K versus 2.0 GiB at 4K.
Auto uses native audio/prompt token counts plus transcript headroom, starting at 4K and growing or shrinking for each recording. The saved setting reaches dictation, uploads, source transcription and reference audio. Active recordings are protected during changes and resizing.
Oversized recordings and token-limited responses now produce actionable errors instead of successful partial transcripts. Older supported runtimes without native token counting retain the previous 64K capacity in Auto, including through the public OpenAI-compatible API; fixed limits remain available to reduce memory.
Validation
UI before / after
Settings > Voice with Local transcription and Qwen3-ASR 0.6B selected, base 91935a1 vs head f41e7ee (two isolated Studio installs). Before: no Voice context row. After: a Voice context row between Load into and Microphone, defaulting to Auto (recommended).
The Voice context menu offers Auto plus fixed limits from 1,024 to 65,536 tokens.