Skip to content

feat(tui): add voice input with Alt+V shortcut#17487

Closed
lemantorus wants to merge 3 commits intoanomalyco:devfrom
lemantorus:feat/voice-input
Closed

feat(tui): add voice input with Alt+V shortcut#17487
lemantorus wants to merge 3 commits intoanomalyco:devfrom
lemantorus:feat/voice-input

Conversation

@lemantorus
Copy link
Copy Markdown

@lemantorus lemantorus commented Mar 14, 2026

What this PR does:
This PR fixes the voice input feature which was broken with "No context found for instance" error:

  1. Root cause: VoiceContextProvider initialized immediately and called Config.get() which requires Instance context. But TUI was running outside Instance.provide() context.

  2. Fix:

    • Move TUI execution inside Instance.provide() in thread.ts and attach.ts
    • Lazy-load voice provider on first Alt+V press instead of on context creation
    • Register /voice command on home screen (was only in session)
  3. New feature: Adds voice input with Alt+V shortcut using Groq/OpenAI Whisper
    Why it works: By running TUI inside Instance.provide(), all config access works correctly. Lazy initialization ensures voice provider loads only when needed.

Screenshots/recordings: Можешь записать скринкаст работы Alt+V

Checklist:

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Screenshots:
Screenshot from 2026-03-14 16-45-14
Screenshot from 2026-03-14 16-45-12
Screenshot from 2026-03-14 16-45-06
Screenshot from 2026-03-14 16-45-02
Screenshot from 2026-03-14 16-42-19
Screenshot from 2026-03-14 16-41-43

I sign off this contribution under the developer certificate of origin (DCO).
Closes #14095

@github-actions github-actions bot added needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Mar 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Related PRs Found

The current PR #17487 addresses voice input functionality in the TUI. I found several related PRs that may be relevant:

  1. PR feat: voice-typing using external Whisper / ALM API #9264 - "feat: voice-typing using external Whisper / ALM API"

    • Related: Also implements voice transcription using Whisper/external APIs
  2. PR feat: add first-party voice transcription with local Whisper #11345 - "feat: add first-party voice transcription with local Whisper"

    • Related: Implements voice transcription with local Whisper integration
  3. PR Add voice-to-text transcription feature #3827 - "Add voice-to-text transcription feature"

    • Related: Earlier voice-to-text transcription implementation

These PRs appear to be related to the voice input feature, but they likely represent different iterations or approaches to voice functionality. PR #17487 is specifically a fix for enabling voice input that was broken, rather than a duplicate of an open issue with the same fix in progress.

Recommendation: Check if PRs #9264 or #11345 are open or merged to understand if this fix (#17487) supersedes them or builds upon previous voice implementation work.

@lemantorus
Copy link
Copy Markdown
Author

lemantorus commented Mar 14, 2026

I hereby sign off this contribution under the developer certificate of origin (DCO).

- Move tui() call inside Instance.provide() in thread.ts and attach.ts
- This fixes 'No context found for instance' error when voice provider
  initializes and tries to access Config.get()
- Voice provider now initializes lazily on first Alt+V press

Signed-off-by: lemantorus <github@lemantorus.com>
The voice settings command was only registered in the session route,
making it unavailable on the home screen.

Signed-off-by: lemantorus <github@lemantorus.com>
- Add VoiceContextProvider to app.tsx
- Add Alt+V keybind handler in prompt component
- Add VoiceIndicator to show recording/transcription status
- Add voice config schema to config.ts

Signed-off-by: lemantorus <github@lemantorus.com>
@lemantorus lemantorus changed the title fix(tui): enable voice input functionality feat(tui): add voice input with Alt+V shortcut Mar 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 14, 2026
@github-actions github-actions bot closed this Mar 14, 2026
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.

[FEATURE]:Can voice input be supported?

1 participant