Add --turn-detection presets to assembly stream#169
Merged
Conversation
Map the documented Aggressive/Balanced/Conservative turn-detection quick-start configs (streaming/universal-streaming/turn-detection) to a single `--turn-detection` flag, so users don't have to hand-set the three raw knobs (--end-of-turn-confidence / --min-turn-silence / --max-turn-silence) from memory. A new isolated aai_cli/streaming/turn_presets.py holds the preset table and a resolve() merge: the preset supplies all three values, and any explicitly-passed raw flag still overrides its own slot. With no preset, behavior is unchanged. --show-code reflects the resolved values for free since both paths read base_flags(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds
assembly stream --turn-detection [aggressive|balanced|conservative], mapping the documented turn-detection quick-start configurations to one flag instead of three raw numbers.end_of_turn_confidencemin_turn_silencemax_turn_silenceValues are verbatim from
streaming/universal-streaming/turn-detectionin the docs.Behavior
--turn-detection conservative --min-turn-silence 200→ min=200, max stays 3600. Lets users start from a preset and tweak one knob.--vad-thresholdis not part of any preset and is untouched.--show-codeshows the resolved numbers for free, since the live path and code-gen both readbase_flags().Design
A new isolated module
aai_cli/streaming/turn_presets.pyholds the preset table + aresolve()merge function — disjoint from shared files, testable on its own.stream/__init__.pygains the option;_exec.py'sbase_flags()callsresolve().Scope
streamonly.agenthas no turn-detection surface today (itsAgentRunConfig/voice-agent session never sets turn params), so presets there are a larger follow-up.Tests
tests/test_turn_presets.py— resolver unit tests (each preset's exact values, per-slot override, passthrough)tests/test_stream_exec.py—base_flags()seamtests/test_stream_command_flags.py— argv →StreamingParametersend-to-endtest_snapshots_help_run.ambrFull gate (
./scripts/check.sh) green: 100% patch coverage, mutation gate clean.🤖 Generated with Claude Code