Skip to content

[ISSUE-031] Fix --stream default model — auto-select sona_speech_1 when no -m given#60

Merged
pillip merged 2 commits into
mainfrom
issue/ISSUE-031-stream-default-model
Jun 17, 2026
Merged

[ISSUE-031] Fix --stream default model — auto-select sona_speech_1 when no -m given#60
pillip merged 2 commits into
mainfrom
issue/ISSUE-031-stream-default-model

Conversation

@pillip

@pillip pillip commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Closes #59

Problem

supertone tts "hello" -v <voice-id> --stream failed with Error: Streaming requires sona_speech_1, but model is sona_speech_2. because _run_tts resolved the model to the generic default (sona_speech_2) on the streaming path. Streaming is only supported on sona_speech_1, forcing users to pass -m sona_speech_1 on every --stream call.

Fix

In src/supertone_cli/commands/tts.py:_run_tts, when --stream is set and no explicit -m/--model is given, resolve the model to sona_speech_1 — bypassing config default_model (which would otherwise always break streaming). An explicit incompatible model (e.g. --stream -m sona_speech_2) still errors as before.

Behavior

  • tts "hi" -v <id> --stream → works (auto sona_speech_1) ✅
  • tts "hi" -v <id> --stream -m sona_speech_1 → works ✅
  • tts "hi" -v <id> --stream -m sona_speech_2 → exit 3, incompatible-model error (unchanged) ✅

Tests

  • test_stream_defaults_to_sona_speech_1 — asserts the resolved model
  • test_stream_explicit_incompatible_model_still_errors
  • Full unit suite: 165 passed; ruff check . clean.

Follow-up (separate repo)

The API-docs en|ko|ja/docs/sdks/cli.mdx currently force -m sona_speech_1 in every --stream example; those can drop the flag once this ships.

pillip and others added 2 commits June 17, 2026 17:08
…en no -m

Streaming only supports sona_speech_1, but `_run_tts` resolved the model to
the generic default (sona_speech_2) on the streaming path too, so
`supertone tts ... --stream` failed unless the user added `-m sona_speech_1`.

When --stream is set and no explicit -m/--model is given, resolve the model
to sona_speech_1 (bypassing config default_model, which would otherwise always
break streaming). An explicit incompatible model still errors as before.

Tests: test_stream_defaults_to_sona_speech_1,
test_stream_explicit_incompatible_model_still_errors.

Closes #59

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rtion

Address review findings on PR #60:
- Add test_stream_default_overrides_config_default_model — covers the PR's
  load-bearing guarantee (config default_model is bypassed on the streaming
  path) which was previously untested (RL-004).
- Assert the "Streaming requires sona_speech_1" message in the
  incompatible-model test to pin the validate_params path.
- Note "keep in sync with _STREAM_MODELS" on the fix comment (RL-005).
- Record review in docs/review_notes.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pillip
pillip merged commit 1f66df0 into main Jun 17, 2026
6 checks passed
pillip added a commit that referenced this pull request Jun 17, 2026
…eview lessons

- CHANGELOG: [Unreleased] entry for --stream auto-selecting sona_speech_1
- README: clarify streaming auto-selects sona_speech_1 when no --model given
- issues.md/STATUS.md: ISSUE-031 Status=done, PR #60
- review_lessons.md: RL-004 frequency 2 (ISSUE-031), new RL-005

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pillip added a commit that referenced this pull request Jun 17, 2026
- src/supertone_cli/__init__.py: bump __version__ to 0.2.2
- CHANGELOG.md: cut [0.2.2] - 2026-06-17
  - Changed: tts --stream auto-selects sona_speech_1 when no --model is
    given, so streaming works without -m sona_speech_1 (ISSUE-031, PR #60)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ISSUE-031] Fix --stream default model — auto-select sona_speech_1 when no -m given

1 participant