Skip to content

chore(chat): remove deployed-chat voice mode - #6215

Merged
waleedlatif1 merged 1 commit into
stagingfrom
chore/remove-voice-mode
Aug 3, 2026
Merged

chore(chat): remove deployed-chat voice mode#6215
waleedlatif1 merged 1 commit into
stagingfrom
chore/remove-voice-mode

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Removes the voice-first interface and TTS playback from the deployed chat. Workspace dictation is a separate feature and is kept.
  • Deletes the VoiceInterface UI + particles canvas, the chat mic input, the TTS audio-streaming hook, the /api/proxy/tts/stream relay and its contract, and the voice-settings query hook.
  • Unpicks the voice wiring in chat.tsx and use-chat-streaming: audio stream handler, sentence-splitting for speech, voice-first mode state, and the isVoiceInput plumbing through ChatInput.
  • Drops the now-dead chatId branch from /api/speech/token, which leaves resolveDeployedChatCaller unused, so that goes too.
  • Removes what the above orphaned: MAX_CHAT_SESSION_MS, the noop util, write-only refs in use-chat-streaming, and the chatId field on the speech contract.

Notes for review

  • Security-relevant: the chatId branch in /api/speech/token was the anonymous public-chat path. With chat voice gone it had no legitimate caller, but leaving it would have kept an unauthenticated STT relay spending the platform ElevenLabs key. Removed rather than left dormant.
  • Kept deliberately: /api/settings/voice, lib/speech/* and use-speech-to-text — the workspace home input still uses them for dictation.
  • Kept deliberately: the voice-output usage source, its pg enum value and its label. Postgres cannot drop an enum value, and historical usage_log rows written while the TTS relay was live still need a label to render on the credit-usage page.
  • This removes the route secured in fix(security): meter and throttle the deployed-chat TTS relay #6212. That fix shipped first, so staging was never left exposed.

Type of Change

  • Chore / removal

Testing

555 tests pass across chat, speech, settings, usage-logs and billing. Typecheck clean on apps/sim and packages/db; all 23 lint tasks pass. Removed two /api/speech/token tests and one use-chat-streaming test that covered the deleted paths. Not manually exercised in a browser.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Removes the voice-first interface and TTS playback from the deployed
chat, keeping workspace dictation, which is a separate feature.

- Deletes the VoiceInterface UI and its particles canvas, the chat mic
  input, the TTS audio-streaming hook, the /api/proxy/tts/stream relay
  and its contract, and the voice-settings query hook.
- Unpicks the voice wiring in chat.tsx and use-chat-streaming: the
  audio stream handler, sentence-splitting for speech, voice-first mode
  state, and the isVoiceInput plumbing through ChatInput.
- Drops the now-dead chatId branch from /api/speech/token. It was the
  anonymous public-chat path; with no caller left it would have stayed
  an unauthenticated relay spending the platform key. That leaves
  resolveDeployedChatCaller unused, so it goes too.
- Removes code the above orphaned: MAX_CHAT_SESSION_MS, the noop util,
  the audio/position refs in use-chat-streaming that were only ever
  written, and the chatId field on the speech contract.

Keeps /api/settings/voice, lib/speech and use-speech-to-text: the
workspace home input still uses them. Keeps the voice-output usage
source, enum and label — Postgres cannot drop an enum value, and
historical usage_log rows still need a label to render.
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 3, 2026 7:00pm

Request Review

@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Large deletion touching chat UX and removes an anonymous STT/TTS surface, but core text chat and workspace dictation remain; regression risk is mainly deployed-chat messaging/streaming, not auth bypass.

Overview
Removes voice-first mode and TTS playback from the deployed chat UI. Visitors now get text-only chat: no full-screen VoiceInterface, mic controls on ChatInput, or auto-played assistant audio while streaming.

Client: Deletes voice UI (VoiceInterface, particles, VoiceInput), useAudioStreaming and its tests, and the useVoiceSettings query. chat.tsx drops voice-first state, TTS wiring, and the isVoiceInput path through send/stream handling. useChatStreaming no longer accepts voice settings or sentence-splitting TTS callbacks.

API / contracts: Removes /api/proxy/tts/stream (route, tests, tts-stream contract) and the anonymous chatId STT path on /api/speech/token, plus unused resolveDeployedChatCaller. Speech tokens are session + verified workspaceId only (editor dictation path).

Intentionally kept: Workspace home dictation (useSpeechToText, /api/speech/token, lib/speech/*, voice settings API) and historical voice-output usage labels for past billing rows.

Reviewed by Cursor Bugbot for commit b5207dd. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes deployed-chat voice input and text-to-speech while preserving workspace dictation.

  • Deletes the deployed voice interface, audio streaming hook, TTS proxy route, and associated contracts and tests.
  • Simplifies deployed-chat input and response streaming to text and attachments.
  • Removes the anonymous deployed-chat branch from speech-token issuance while retaining session-authenticated, workspace-scoped token issuance.

Confidence Score: 5/5

The PR appears safe to merge with no actionable changed-code defects identified.

The removed voice-only UI, streaming, API, and contract paths have no remaining callers, while text chat, attachment submission, and authenticated workspace dictation retain consistent call and authorization contracts.

Important Files Changed

Filename Overview
apps/sim/app/(interfaces)/chat/[identifier]/chat.tsx Removes deployed-chat voice state, controls, audio playback, and voice-specific submission wiring while preserving text and attachment submission.
apps/sim/app/(interfaces)/chat/components/input/input.tsx Removes voice-only properties and microphone controls and consistently updates the submission callback to pass attachments as its second argument.
apps/sim/app/(interfaces)/chat/hooks/use-chat-streaming.ts Removes voice-specific sentence segmentation and audio callbacks without altering the established text-stream parsing and terminal-state handling.
apps/sim/app/api/speech/token/route.ts Removes the intentionally deprecated anonymous deployed-chat token branch and retains authenticated workspace membership, billing, rate-limit, and usage checks.
apps/sim/lib/api/contracts/media/speech.ts Removes the obsolete chatId request field while preserving the workspaceId contract used by workspace dictation.
apps/sim/app/api/proxy/tts/stream/route.ts Deletes the deployed-chat TTS relay as part of the voice-output feature removal.

Reviews (1): Last reviewed commit: "chore(chat): remove deployed-chat voice ..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit 78740c0 into staging Aug 3, 2026
27 checks passed
@waleedlatif1
waleedlatif1 deleted the chore/remove-voice-mode branch August 3, 2026 19:05
waleedlatif1 added a commit that referenced this pull request Aug 3, 2026
* refactor(chat): clean up the deployed chat surface

Eight-angle cleanup pass over the full contents of the chat surface and
the speech code that survived the voice-mode removal.

Dead code
- enforceChatRateLimit: added for the TTS relay in #6212, orphaned when
  #6215 deleted that route. Zero consumers.
- ChatToolCallStatus, ChatErrorType, and six unused CHAT_ERROR_MESSAGES
  keys (only GENERIC_ERROR and CHAT_UNAVAILABLE are read).
- scrollToMessage was declared and destructured by ChatMessageContainer
  but never used in its body; removing the prop also made the
  scrollToShowOnlyMessage branch unreachable, since the sole caller
  passed true.
- permissionState and the language prop on useSpeechToText: both
  write-only across the repo.
- The image branch in ChatFileDownload's renderIcon returned the same
  DefaultFileIcon at the same size as the fallback.
- chatKeys.status/detail: aliases of deploymentKeys nothing imported,
  and misleading since they root under a different key namespace.

Redundant state
- password-auth and email-auth each kept a boolean in lockstep with
  `errors.length > 0`; email-auth also validated on every keystroke and
  then immediately hid the result.
- file-download tracked hover in state to drive one opacity class; now
  group-hover. Verified emcn Button sets no `group` class of its own.

Memoization
- ChatMessageContainer's memo() could never bail: chat.tsx passes an
  inline arrow for scrollToBottom and displayMessages is a fresh array.
  Four of the five things that re-render ChatClient are its props
  anyway, so the memo is dropped rather than propped up.
- ClientChatMessage keeps its memo — it blocks markdown re-parsing —
  but loses the custom comparator, which compared proxies (a
  key:status fingerprint, files by length) and ignored attachments and
  type entirely. Default shallow compare on its single prop is both
  simpler and stricter.
- Six useCallbacks whose consumers are native DOM handlers or inline
  arrows, so nothing observed their identity.

Effects
- The scroll listener attached in an effect keyed on [chatConfig,
  authRequired] — values it never reads, standing in for "the container
  has mounted". It now attaches via a ref callback, so it no longer
  re-attaches on every config refetch.

Design system and a11y
- z-[100] -> z-[var(--z-dropdown)] (same value), shadow-lg ->
  shadow-medium, list styles from inline style to Tailwind classes,
  hover: -> hover-hover: on touch-reachable targets, Check sourced from
  emcn alongside its Duplicate pair.
- Accessible names on the remove-attachment, stop, and send buttons,
  which announced only as "button".
- Dropped a keyboard handler on a role='group' div with no tabIndex,
  where target === currentTarget was unreachable, and the Tooltip
  Provider wrappers and delayDuration, which emcn documents as
  no-op passthroughs.

* fix(chat): restore markdown list markers

The design-system pass swapped inline `listStyleType` for Tailwind
classes, but the edit that added `list-disc`/`list-decimal` silently did
not apply while the one removing the inline style did. With Preflight
setting `list-style: none`, every bullet and number in an assistant
response disappeared. `list-item` on the `li` sets display only, not the
marker type.
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