Fix quadratic Wyoming audio buffering - #634
Merged
Merged
Conversation
Greptile SummaryThe PR replaces repeated immutable PCM concatenation with in-place bytearray accumulation, converting the buffer to bytes once before WAV creation. It also adds a focused regression test and aligns the pre-commit Ruff hook with the project’s 0.15 tooling baseline.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| agent_cli/server/whisper/wyoming_handler.py | Replaces quadratic bytes concatenation with bytearray extension while preserving stop-path audio contents and lifecycle behavior. |
| tests/test_server_whisper_wyoming.py | Adds a regression test confirming that successive audio chunks accumulate in the same buffer. |
| .pre-commit-config.yaml | Pins ruff-pre-commit to v0.15.22 to align with the repository’s Ruff 0.15 baseline. |
Reviews (2): Last reviewed commit: "ci: pin Ruff hook to project baseline" | Re-trigger Greptile
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
bytearrayto avoid copying the complete recording for every chunkbytesonce when recording stops, then reuse the bufferTesting
uv run --all-extras pytest(1477 passed, 4 skipped)uv run ruff check .uv run pre-commit run --all-files