Repository navigation
fix(hume): reject instant_mode without a voice in update_options - #2851
Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
rosetta-livekit-bot[bot] wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 9086d8f The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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
Testing
pnpm test plugins/humepnpm exec turbo run build --filter=@livekit/agents-plugin-hume...pnpm --filter @livekit/agents-plugin-hume lintpnpm --filter @livekit/agents-plugin-hume api:checkpnpm exec prettier --check "plugins/hume/src/**/*.{ts,tsx,md,json}" ".changeset/quiet-pandas-smile.md"Source diff coverage
Source diff coverage
livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/tts.py: adapted toplugins/hume/src/tts.ts, with explicit nullable voice type support inplugins/hume/src/models.tsand the generated update inplugins/hume/etc/agents-plugin-hume.api.md. TypeScript needsnullto distinguish an explicit no-voice value from an omitted optional property; constructor defaulting and validation were brought to the source baseline so the update validation has the same state model.tests/test_plugin_hume_tts.py: adapted toplugins/hume/src/tts.test.ts. Both source tests were ported: rejected updates remain atomic, and consistent joint voice/instant-mode updates succeed. No additional behavioral tests were added.Ported from livekit/agents#8090
Original PR description
Problem
hume.TTSrefuses instant mode without a voice in the constructor, butupdate_optionsdoesn't check it:Both calls store a configuration Hume rejects, so the mistake only shows up later as an API error on the next synthesis.
Fix
update_optionschecks the options the update would produce (each given value, else the current one) before changing anything, and raises the constructor'sValueError. A rejected update leaves the options as they were. Dropping the voice still works wheninstant_mode=Falseis passed in the same call.Tests
New
tests/test_plugin_hume_tts.py(hermetic,unitmarker):test_update_options_rejects_instant_mode_without_a_voice: both calls above raise, and the rejected update changes no option (includingspeedpassed alongside). Fails onmain.test_update_options_accepts_a_consistent_voice_and_instant_mode: clearing the voice together withinstant_mode=False, and setting a voice together withinstant_mode=True, still work.#7472 also edits
hume/tts.py(thetrailing_silencecheck inChunkedStream._run). The two changes are in different functions.🤖 Generated with Claude Code