Repository navigation
fix(web): voice setup picks a backend first and never dead-ends - #84
Conversation
Transcribe with now lists backends (AssemblyAI recommended, OpenAI, Grok, OpenRouter, Local model) instead of environments, and runs the choice on this device's environment by default. Overriding the environment is an optional Advanced row that appears only when more than one environment can run the backend, so there is no "environment without a backend" state. The setup dialog no longer says "Connect ... to continue" with only Cancel: an offline environment offers Open Environments, and a dialog with nothing to do says Close. The server also accepts an AssemblyAI key from ASSEMBLYAI_API_KEY in its launch environment (for example injected from the vault), reports it as host-managed so the UI offers nothing to type or remove, and drops it from its own environment so agent subprocesses don't inherit it. A key saved in settings still wins. First-time dictation offers AssemblyAI straight away. Model: claude-opus-5-5 Task: fix Agent: claude-code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Verdict: one blocking finding, so I did not merge. Head reviewed: Blocking1. "Connected" is tested against the wrong connection phase, so the default-environment rule is inverted in the real app.
connected: environment.connection.phase === "available",In this codebase What that does to
Why the tests pass anyway:
Fix: compare against Passed
Non-blocking
Does merging publish anything externally? No.
StatusNot merged. Checks on the exact head are green (ARC CI success; CodeRabbit success, though its description says it skipped review for this base branch). One fix round on finding 1 and this is ready. I pushed nothing, ran no builds, dispatched no workflow, and touched no keys. |
The voice panel compared connection.phase to "available", which means a known environment that is not connected, so the first-connected rule never picked a live environment. Move the mapping into voiceEnvironmentCandidates, compare against "connected", fix the browser fixture, and add a two-environment test. Model: claude-opus-5-5 Task: fix Agent: claude-code Harness: t3-claude Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes the blocking finding in the review above: voice defaults treated
Local results
This is fix verification within the same review round, not a new round. |
Setting up AssemblyAI dictation was confusing and could dead-end. Transcribe with listed environments ("On an environment → primary-r720") next to per-environment cloud groups ("Cloud via primary-r720 → AssemblyAI"). You could pick an environment without a backend, or a backend by environment. When the environment wasn't reachable, the dialog said "Connect to primary-r720 with dictation access to continue." and offered only Cancel. Admins also had to type the AssemblyAI key by hand.
What changed
ASSEMBLYAI_API_KEYfrom its launch environment (for exampleinfisical run --path /agent-runtime -- …). The key-presence response reports it ashostManaged, so the dialog offers Use AssemblyAI with no key field and no Remove key. The server reads the key once and deletes it from its ownprocess.env, so agent subprocesses don't inherit it. A key saved in settings still wins over it.Surfaces: web and desktop share this panel. Mobile is unchanged: its cloud sheet is still environment-first, but it already sees the host key as configured. That redesign is a follow-up. Providers, connection modes, and the user docs (
voice-input.md,faq.md) are updated.Before
After
Screenshots come from a local dev server on the R720 with an empty database. The server was started with a fake
ASSEMBLYAI_API_KEYvalue, not the real vault key. The offline state was produced by stopping that dev server.Tests
apps/web/src/components/settings/CloudVoiceConfiguration.browser.test.tsx: a new no dead end check. Every dialog state must offer a forward action, any "open X" or "press X" must name a button that exists, and "continue" is only allowed next to a Continue button. It covers the offline environment and the host-managed one-click first run. Existing flows are updated to the backend-first menu.apps/web/src/speech/voiceBackends.test.ts: default environment selection.apps/server/src/speech/CloudSpeech.test.ts: covers the host key. It's used without settings, a saved key outranks it, removing the saved key falls back to it, and it's dropped fromprocess.env.effect-tsgotypecheck for web, server and contracts, plusvp fmt --checkandvp linton changed files, all clean.Rollout
Merging makes AssemblyAI the recommended default in the fork. To make it work with no typing, each fleet host has to launch T3 with
ASSEMBLYAI_API_KEYfrom Infisical/agent-runtimein its environment. That step is outside this PR and belongs with the deployment lanes.Model: claude-opus-5-5
Task: fix
🤖 Generated with Claude Code