[codex] Guard optional audio codec imports#7928
Open
tianmind-studio wants to merge 6 commits into
Open
Conversation
kodjima33
approved these changes
Jun 16, 2026
kodjima33
left a comment
Collaborator
There was a problem hiding this comment.
Backend hardening (guard optional audio codec imports; larger diff) — approve only per policy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
utils.other.storageandrouters.syncuntil code actually needs Opus encode/decode.routers.transcribeOpus and LC3 imports so missing optional codec libraries do not block non-codec module import paths.opuslib, and skip storage tests that require real libopus when the native library is unavailable.Root cause
On Windows, installing the
opuslibPython package is not enough if the native libopus DLL is missing. Importingopuslibcan raise during module import, which previously prevented backend modules such asutils.other.storageandrouters.syncfrom loading even when the current path did not need Opus processing.Validation
python -m pytest backend\tests\unit\test_optional_audio_codecs.py backend\tests\unit\test_storage_opus_encoding.py -q --tb=short-> 38 passed, 11 skippedpython -m pytest backend\tests\unit\test_sync_opus_decode.py -q --tb=short-> 21 passedpython -m py_compile backend\utils\other\storage.py backend\routers\sync.py backend\routers\transcribe.py backend\tests\unit\test_optional_audio_codecs.py backend\tests\unit\test_storage_opus_encoding.pypython -m black --check --line-length 120 --skip-string-normalization backend\utils\other\storage.py backend\routers\sync.py backend\routers\transcribe.py backend\tests\unit\test_optional_audio_codecs.py backend\tests\unit\test_storage_opus_encoding.pygit diff --checkbash -n backend/test.shbash scripts/pre-commitLint Checkrun 4999 -> successNote
backend/test-preflight.shstill fails on this Windows checkout becauseorigin/maincan select the WindowsAppspython3alias instead of the active venv; that separate preflight issue is already covered by #7926.Related: #7628