Skip to content

fix(tts): protect direct Cartesia keys and redact provider errors - #774

Draft
axelpey wants to merge 2 commits into
feat/cartesia-api-keyfrom
codex/cartesia-key-safety
Draft

fix(tts): protect direct Cartesia keys and redact provider errors#774
axelpey wants to merge 2 commits into
feat/cartesia-api-keyfrom
codex/cartesia-key-safety

Conversation

@axelpey

@axelpey axelpey commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Follow-up to David's #755, based on feat/cartesia-api-key. This changes only the Cartesia transport and its tests; it does not modify David's branch, select another voice, or resolve the Alfred voice-access blocker.

Direct and proxy failures can reach robot chat/logs through TTS handling. They now expose only HTTP status or a generic request failure, with no upstream body, headers, or exception chain. Public-demo sessions (INNATE_PUBLIC_DEMO=1, true, or yes) cannot select, construct, or use a direct Cartesia transport. The configured proxy still wins and never falls back to a different account after an error. Warmup remains status-agnostic because HEAD is only for connection reuse and may legitimately return 405.

21 tests passed using the actual TTS handler, real proxy adapter and httpx client with controlled network transport: exact Alfred/default voice forwarding, speech body and headers, optional generation config, client reuse/closure, proxy precedence, missing key, rejected credential/partial stream/warmup error redaction, and public-demo guard. Ruff and diff checks pass. No real provider key or physical audio device was used. A separate combined roundtrip with #773 and #772 successfully saved controlled keys through the CLI, loaded them with the real hardware launch loader, and exercised OpenAIContext plus the Cartesia TTSHandler against local HTTP provider doubles; 54 combined provider/TTS tests passed.

The original #755 must remain blocked until Alfred works consistently with the intended non-owning Cartesia key. Owner-local key configuration is separate draft #773; OpenAI Responses runtime is separate draft #772. No deployment or PR-status changes were made.

Keep this follow-up draft until Axel explicitly approves it.

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