Skip to content

berd-call: keep the saved Spokesperson voice across session restarts - #414

Closed
johnmatthewtennant wants to merge 1 commit into
mainfrom
jtennant/berd-call-keep-spokesperson-voice
Closed

johnmatthewtennant wants to merge 1 commit into
mainfrom
jtennant/berd-call-keep-spokesperson-voice

Conversation

@johnmatthewtennant

Copy link
Copy Markdown
Contributor

Context

berd-call saves the call's session options, including --spokesperson-voice and --spokesperson-rate, in its saved settings file. Those two flags are only valid with --mode expert-spokesperson --allow-direct-agent-speech. Call start already keeps them for later when the call doesn't take them ("Calls whose replies don't have their own voice keep the Spokesperson's for later").

Problem

Turning the Spokesperson off and back on resets its voice to the default, marin. Turning it off restarts the session into conventional mode, and SessionActor::restart_start replaced the saved arguments with the new session's persistable arguments, which can't contain the Spokesperson flags. The saved voice and rate were lost, and turning it back on (from the CLI or the menu bar, which both go through set_spokesperson_mode) built its restart arguments from the live session, which also had no voice.

Solution

restart_start now merges the new session's arguments over the saved Spokesperson flags, as call start does, so they survive a restart into a mode that can't carry them. When the restart's session takes them (direct agent speech) and doesn't set --spokesperson-voice itself, it starts with the saved voice. The rate is deliberately not injected, since the Spokesperson's speed follows the agents' on a toggle. Explicit flags win. Both the CLI and menu bar toggles share this restart path, so no other change is needed.

Validation

New test restart_keeps_the_saved_spokesperson_voice_for_later covers a restart into conventional mode (flags stay saved only), into expert-spokesperson with direct speech (saved voice added to the session arguments), and with an explicit voice (explicit wins).

  • Red, before the fix: the test fails with left: ["--mode", "conventional"], right: ["--spokesperson-voice", "cedar", "--spokesperson-rate", "1.1", "--mode", "conventional"].
  • Green, after the fix: test host_session::tests::restart_keeps_the_saved_spokesperson_voice_for_later ... ok.
  • cargo test -p berd-call --no-fail-fast: the same 5 tests fail on origin/main with and without this change (openai_spokesperson::tests::input_cutover_waits_for_committed_transcription_terminal, host_session::tests::spokesperson_results_change_and_save_only_its_voice, management_usage_errors_are_exit_two_and_do_not_emit_json, unresolved_handoff_at_provider_expiry_fails_without_starting_a_replacement, synthesis_usage_errors_are_exit_two_and_emit_no_json); everything else passes (lib 304, bin 224 with the new test, help_cli 7, session_protocol 43).
  • cargo fmt --check -p berd-call passes. cargo clippy -p berd-call --all-targets -- -D warnings reports 8 existing errors in other files (new chunks_exact_to_as_chunks and similar lints); none are in host_session.rs.

🤖 Generated with Claude Code

A restart replaced the saved arguments with the new session's, so turning
the Spokesperson off (a mode that can't carry --spokesperson-voice and
--spokesperson-rate) erased them, and turning it back on started with the
default voice. Keep them as call start does, and start a restart that can
carry them with the saved voice unless it sets its own.

Signed-off-by: John Tennant <jtennant@block.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johnmatthewtennant

Copy link
Copy Markdown
Contributor Author

🤖 Folded into #416 for review and merge.

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.

1 participant