Repository navigation
Conversation
- convert_wav_with_path deleted the caller's input file after a successful ffmpeg conversion. The converted audio only lives in memory, so the original recording was lost. Stop deleting it. - AsrWsClient wrote its credentials into the module-level config and every connection read them from there, so creating a second client made the first one connect with the second one's app key and token. Keep credentials on the instance and pass them to new_auth_headers; the default argument keeps existing callers working.
This branch has not been deployed
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.
Two bugs in
veadk/toolkits/audio/asr/asr_client.py.The caller's audio file is deleted. For non-WAV input,
CommonUtils.convert_wav_with_pathruns ffmpeg with output to stdout and then callsos.remove(audio_path). The converted audio only exists in memory, soAsrWsClient.execute("meeting.mp3")/read_audio_data(...)removes the user's original recording, even when the ASR request fails afterwards. The client doesn't create that file and shouldn't delete it, so this PR drops the removal.Clients share credentials.
AsrWsClient.__init__writesapp_id/access_tokeninto the module-levelconfig, andcreate_connectionbuilds headers from that global. With two clients in one process, the first one connects with the second one'sX-Api-App-Key/X-Api-Access-Key. Each client now keeps its ownConfigand passes it toRequestBuilder.new_auth_headers(auth_config). The parameter defaults to the module-level config, and the constructor still updates that config, so existing direct callers ofnew_auth_headers()behave as before.Tests
New
tests/toolkits/test_asr_client.py(ffmpeg and the websocket session are mocked, no network):test_read_audio_data_preserves_non_wav_sourcetest_connections_use_each_clients_credentialstest_auth_header_builder_keeps_default_call_compatible(compatibility check, passes before and after)On
main: 2 failed, 1 passed. On this branch: 3 passed.Full suite (
uv run --extra dev pytest -n 4 -m "not codex_smoke and not piagent_smoke"): 26 failed, 2 errors, 8052 passed. The same 28 failures/errors occur on unmodifiedmainin my environment (tests/runtime/codex/*,tests/cloud/test_harness_app_contract.py,tests/frontend/test_migration_delivery_recovery.py,tests/runtime/test_self_host_sandbox_*), so none are new. Ruff 0.11.12 (the pre-commit version)checkandformat --checkare clean on the changed files.