Skip to content

fix(chat): TTS Manager never stops after upstream errors#5

Merged
entitycs merged 0 commit into
devfrom
dev-latest
Jun 18, 2026
Merged

fix(chat): TTS Manager never stops after upstream errors#5
entitycs merged 0 commit into
devfrom
dev-latest

Conversation

@entitycs

Copy link
Copy Markdown
Owner

Summary

Addresses error: "ReferenceError: streamingTTS is not defined". Catches (2) closely aligned bugs in the same scope.

Alternate title (not far-reaching, promise): "fix(chat): Fix undefined variable bugs leading to uncaught exceptions in error-handling logic"

TTS Manager fails to reach an expected lifecycle state -- never stops or ends stream on upstream errors which throw within the scoped context in which the streamingTTS variable lives (lived). This fix addresses that error, along with two bugs serving as the cause of 2 additional repeat errors in the same scope.

Target branch

  • This PR targets dev, not main. All PRs land in dev; main is curated by the maintainer at each release. If your PR is on main by accident, click "Edit" on this PR and change the base.

Linked Issue

Part of odysseus-dev#3603 (Issue 1 of 2)
Part of odysseus-dev#3681 (May fix odysseus-dev#3603, Issue 2 of 2, but only avoids the bug actually causing Issue 1 - this fixes the bug which causes that slice of the issue)

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
    • includes fix for all related bugs within the target catch scope -- leaves many unused vars, and similar issues outside of the given try/catch scope, etc., but does catch more that one bug under the same pattern in the same scope.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.

How to Test

  1. Apply patch onto any commit containing the linked 'Part of' issues (in case a PR is merged which 'fixes' (or bypasses) the underlying issue on the frontend.
  2. Verify no new failed tests after running python -m pytest
  3. Verify no new errors are displayed in the browser console
  4. Reproduce errors from 'Part of' issues.
  5. Verify lack of browser console error: 'ReferenceError: streamingTTS is not defined`

Visual / UI changes — REQUIRED if you touched anything that renders

Anything that changes what the UI looks like — buttons, icons, padding, colors, fonts, spacing, layout, CSS, HTML, SVG, or any static/js/ module that draws to the DOM — needs all of the following. PRs that change rendering without these WILL be closed.

  • Screenshot or short clip of the change in the running app, attached below. Mobile screenshot too if the change affects mobile.
  • Style match: the change uses Odysseus's existing visual language. Specifically:
    • Reuse existing CSS variables (--red, --fg, --bg, --card, --border, etc.) — do not introduce new color values, font sizes, or spacing units.
    • Reuse existing button/input/card/border classes. Don't invent parallel styling.
    • No Unicode emoji in UI or code. Use inline SVG (matching the monochrome icon style already in static/index.html) or plain text.
    • Monospaced font (Fira Code) for primary UI text. Don't override.
    • Dark theme is the default; any light-mode work must be wired through the existing theme system, not hard-coded.
  • No new component patterns. If a similar widget already exists in the app, extend it instead of writing a parallel one.
  • I am not an LLM agent submitting a bulk PR. If you are, please open an issue describing the problem first — bulk auto-generated PRs that don't match the project's visual style are closed on sight, even when the underlying fix is correct.

Screenshots / clips

Comment thread static/js/chat.js

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • streamingTTS, _isAgent changed from const to let.

    • No negative implications unless code ownership is implied
  • streamingTTS could still end up undefined

    • but at least some reason as to why can hit the logs

Is there a more standardized logging system to use?

@github-actions github-actions Bot added the merge conflict Conflicts with the base branch; needs a rebase before review. label Jun 18, 2026
@entitycs
entitycs merged commit 0620ebe into dev Jun 18, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Conflicts with the base branch; needs a rebase before review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

streamingTTS frontend error and stalled streams with NVIDIA DeepSeek V4 Pro / MiniMax

1 participant