feat(voice): pin remote voice + reach Cloudflare fish-speech [spec 02]#22
Open
wine-fall wants to merge 3 commits into
Open
feat(voice): pin remote voice + reach Cloudflare fish-speech [spec 02]#22wine-fall wants to merge 3 commits into
wine-fall wants to merge 3 commits into
Conversation
Make the remote fish-speech backend usable against the hosted, Cloudflare- fronted endpoint and give it a stable voice: - Named User-Agent: urllib's default "Python-urllib/*" UA is 403'd by the server's bot rule; send "murmur" instead. - MURMUR_TTS_SEED pins the sampled timbre (fish-speech has no preset voices, so each /v1/tts call otherwise samples a new voice). Threaded config -> build_voice -> provider -> payload, mirroring reference_id/api_key. - Robustness (from review): a non-numeric seed warns + degrades to unpinned instead of aborting every Config() (incl. spark/stub); the endpoint URL is stripped so a CRLF/whitespace .env value cannot corrupt the host. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- `make dev-remote` loads a gitignored .env and runs the dev flow forcing the off-machine HTTP voice; when no endpoint is configured it exits early with a helpful .env template (before the slow install/preflight). - .gitignore: .env (machine-local endpoint config, never committed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the real Cloudflare-fronted host with a placeholder in the dev-remote template and drop the operator name from a code comment; the actual endpoint lives only in the gitignored .env. 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 & why
The remote off-machine TTS backend (PR #21) was correct against a bare
fish-speech server, but did not work against the hosted, Cloudflare-fronted
endpoint (
fish-speech.opuslab.ai), and every call sampled a fresh voice.This hardens it for real use.
Implements
specs/spec02/02-voice-provider.md(§3.6, amended).Changes
Python-urllib/*User-Agent is 403'd by the server's bot rule. Send a namedUser-Agent: murmurinstead. Verified end-to-end against the live endpoint(was 403 → now 200 wav).
reference each
/v1/ttscall samples a new timbre.MURMUR_TTS_SEEDfixesit; threaded
config → build_voice → provider → payload, mirroring theexisting
reference_id/api_keypath. Confirmed deterministic (identicalbytes across calls) live.
make dev-remote(chore): loads a gitignored.envand runs the devflow forcing the off-machine voice; exits early with a helpful
.envtemplate when no endpoint is configured (before the slow install/preflight).
.envis gitignored.Review fixes (in this change)
Closing peer review surfaced three real issues, each fixed + regression-tested:
MURMUR_TTS_SEEDwarned + degrades to unpinned instead ofaborting every
Config()(it would have crashed spark/stub too).strip()ed so a CRLF/whitespace.envvalue can'tcorrupt the host.
VOICE=remotefrom the.envtemplate (the target forcesit via CLI; leaving it would hijack a plain
make devafter a manual source).Testing
uv run pytest— all green (216), incl. new regression tests for the seedparse, URL strip, User-Agent, and seed threading.
pre-commit run --all-files— source-language + pyright pass.fish-speech.opuslab.aiover WARP: real/v1/ttsreturns wav; seed pinning deterministic;
dev-remotemissing-.envguard.AI coding brief
wire the interface in, look at the latest PR first." The goal was to get
murmur's companion voice onto a heavier, higher-quality off-machine TTS.
Cloudflare Access; asked for a fixed seed rather than a registered reference;
asked for a
make dev-remoteconvenience target; and explicitly pushed forthe missing-
.envcase to be handled thoroughly (which surfaced the guardand, via review, the crash-all seed bug).
endpoint is WARP/Access-gated; here's a service token or I'll enable WARP"
would have saved a round of auth debugging. When adding a config knob that
only one code path uses, decide its failure mode (ignore vs abort) at design
time, not in review.
Peer review (codex gpt-5.5): skipped — workspace out of credits; fell back to
the
code-reviewskill (high effort): 3 findings applied, 5 dismissed.🤖 Generated with Claude Code