continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
18.83k stars 1.59k forks source link

"Stop TTS"-Button doesn't stop TTS #2311

Open Snowman-25 opened 1 month ago

Snowman-25 commented 1 month ago

Before submitting your bug report

Relevant environment info

- OS: Windows 11 23H2 (Build 22631.4169)
- Continue:   v0.8.52
- IDE:        VSCode 1.92.1 (user setup)
- Model:      n/a
- config.json:

{
  "models": [
    {
      "title": "Ollama",
      "provider": "ollama",
      "model": "AUTODETECT"
    }
  ],
  "customCommands": [
    {
      "name": "test",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
      "description": "Write unit tests for highlighted code"
    },
    {
      "name": "desc",
      "prompt": "{{{ input }}}\n\nWrite a comprehensive comment for each block of the selected code. It should describe what it does and show possible caveats.",
      "description": "Comment the highlighted code"
    }
  ],
  "tabAutocompleteModel": {
    "title": "Starcoder 3b",
    "provider": "ollama",
    "model": "starcoder2"
  },
  "allowAnonymousTelemetry": false,
  "embeddingsProvider": {
    "provider": "transformers.js"
  },
  "contextProviders": [
    {
      "name": "open",
      "params": {
        "onlyPinned": false
      }
     }
  ],
  "experimental": {
    "readResponseTTS": true
  },
  "ui": {
    "showChatScrollbar": true
  },
  "docs": []
}

Description

After activating TTS, while a response is spoken, there's a "Stop TTS"-Button where the 'Cancel' button is when the model is still generating an answer. It doesn't work. TTS-Output doesn't stop.

To reproduce

  1. Activate TTS by adding readResponseTTS: True to your experimental-section in config.json
  2. Enter any prompt
  3. While the prompt is being read, press "Stop TTS"

Log output

No response

Patrick-Erichsen commented 1 month ago

Tried this on macOS + VS Code and TTS output was stopped.

This is likely a Windows specific issue since we handle TTS in core.

Here is how we init the TTS process on Windows: https://github.com/continuedev/continue/blob/0cfcc599de1a54ae0e9c1bbcb09c5f3d0e03a126/core/util/tts.ts#L67-L72

Here's the relevant "kill" logic: https://github.com/continuedev/continue/blob/0cfcc599de1a54ae0e9c1bbcb09c5f3d0e03a126/core/util/tts.ts#L91-L113

My best guess is that we're not finding the process on Windows for some reason.