8000 Voice dictation cannot work on a production start without undocumented env vars (#27) by simon-inkie · Pull Request #58 · simon-inkie/inkie-deck · GitHub
[go: up one dir, main page]

Skip to content

Voice dictation cannot work on a production start without undocumented env vars (#27) - #58

Merged
simon-inkie merged 5 commits into
mainfrom
27-voice-proxy-origins
Oct 11, 2026
Merged

simon-inkie merged 5 commits into
mainfrom
27-voice-proxy-origins

Conversation

@simon-inkie
Copy link
Copy Markdown
Owner

Requested by Simon · project thread

Closes #27

Summary

Before: the voice proxy only accepted WebSocket upgrades from http://localhost:5174, so on a production start (port 4242) the mic failed with a console WebSocket error. The VOICE_* variables were not in .env.example and the setup was not in INSTALL.md.

After: the default allowlist is Deck's own http://localhost:$PORT (4242 unless PORT is set) plus the dev port, so with only DEEPGRAM_API_KEY set the mic works on a local production start. Without a key the mic is disabled and reads "voice disabled: no DEEPGRAM_API_KEY".

How:

  • server/voice-relay.mjs: defaultAllowedOrigins and resolveAllowedOrigins, used by voice-proxy.mjs. A blank VOICE_ALLOWED_ORIGINS falls back to the default; an explicit value still replaces it.
  • .env.example and INSTALL.md: commented VOICE_ALLOWED_ORIGINS, VOICE_PROXY_URL, VOICE_PROXY_HOST, and a "Voice dictation" walkthrough including Tailscale with wss://. Stale "not in .env.example" claims corrected.
  • Mic state: the launchers set VOICE_DISABLED_REASON for the app when there is no key; the loader passes it to Compose. See the SPEC for why it is not read in app/ directly: test/seam.test.ts bans the key's name from app/.

SPEC: .specs/27-voice-proxy-origins/SPEC.md

Test plan

  • New test/voice-proxy-origins.test.ts: default-origin computation, plus a process test spawning the real proxy with only PORT set.
  • New test/voice-server.test.ts.
  • Typecheck, deck tests, boundaries, leaks, licence, lib-version, dashes pass.
  • Manual on a real build: key set, upgrade from http://localhost:4242 accepted; no key, disabled note rendered.

Not measured: a real browser with a Deepgram session, and the tailscale serve steps (INSTALL.md says so).

Known red, not from this branch: check:leaks:messages flags commits already on main; packages/base has 4 failing shell-suite tests in my sandbox.

🤖 Generated with Claude Code

https://claude.ai/code/session_018Lv5tyToePMMcuLwtrEHnG


Generated by Claude Code

claude added 3 commits October 7, 2026 15:36
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
…setup (#27)

The proxy only allowed http://localhost:5174, so a production start on 4242
had its WebSocket upgrade rejected. Default to http://localhost:$PORT plus the
dev port, document VOICE_ALLOWED_ORIGINS, VOICE_PROXY_URL and VOICE_PROXY_HOST
in .env.example and INSTALL.md (including Tailscale with wss), and show the mic
as disabled when there is no key.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@simon-inkie simon-inkie self-assigned this Oct 7, 2026
Strip trailing slashes from VOICE_ALLOWED_ORIGINS, validate PORT, move the
disabled note out of the textarea box, share the launchers' reason helper,
harden the process test, add a Compose component test, and record the review
in the SPEC.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Claude <noreply@anthropic.com>
@simon-inkie
Copy link
Copy Markdown
Owner Author

Review leg: Aggy (AI review agent).
Verdict: ready to merge.
Checked: matches issue #27 cleanly with no scope creep. Default origins correctly derive from the app port and dev port in server/voice-relay.mjs, env vars are documented in .env.example, INSTALL.md includes local and Tailscale walkthroughs, and UI cleanly surfaces the disabled state when no key is present without exposing the key name in the app bundle. SPEC present and honest. Leak, licence, and lib-version gates pass; GitHub CI suite passes (Node 22 and 24).
Not verified: live browser microphone stream with an active Deepgram API key; tailscale serve endpoint.
Merge decision stays with the maintainer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018uNaFhmK6yxSR7XfzJDY3Z
Signed-off-by: Simon <simon@inkie.ink>
@simon-inkie
simon-inkie merged commit bc365cb into main Oct 11, 2026
4 checks passed
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.

Voice dictation cannot work on a production start without undocumented env vars

2 participants

0