Skip to content

fix(voice): honor PULSE_SERVER/PIPEWIRE_REMOTE inside Docker (#21203)#22534

Merged
benbarclay merged 2 commits into
NousResearch:mainfrom
wesleysimplicio:fix/voice-mode-docker-respect-pulse-pipewire
May 27, 2026
Merged

fix(voice): honor PULSE_SERVER/PIPEWIRE_REMOTE inside Docker (#21203)#22534
benbarclay merged 2 commits into
NousResearch:mainfrom
wesleysimplicio:fix/voice-mode-docker-respect-pulse-pipewire

Conversation

@wesleysimplicio

@wesleysimplicio wesleysimplicio commented May 9, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

detect_audio_environment() unconditionally added a hard warning when running inside a Docker/Podman container, blocking /voice on even when the host PulseAudio/PipeWire socket was correctly mounted and sounddevice could enumerate devices (issue #21203).

Root cause

The detailed rationale from the original PR body is preserved below. This template update keeps the review structure consistent with #29640.

Fix

Mirror the existing WSL/PulseAudio handling at tools/voice_mode.py:110-125:

  • If is_container() and PULSE_SERVER or PIPEWIRE_REMOTE is set → downgrade to an informational notices entry (does not block voice).
  • If is_container() and neither is set → keep the hard block, but extend the message with the exact -v / -e flags users need.

No public surface changes. detect_audio_environment() still returns {available, warnings, notices}.

Why this shape

This shape mirrors #29640 so reviewers can quickly compare scope, root cause, fix, tests, and related context without having to decode a custom PR description.

Tests

  • Veja a descrição original preservada abaixo para detalhes de validação, testes e notas de verificação.
Original body

Related PRs / issues

Closes #21203

Original body

Summary

detect_audio_environment() unconditionally added a hard warning when running inside a Docker/Podman container, blocking /voice on even when the host PulseAudio/PipeWire socket was correctly mounted and sounddevice could enumerate devices (issue #21203).

What Changed

  • Standardized this PR body to the current Hermes Turbo template.
  • Preserved the original detailed description below for reference.

Fluxo

A mudança continua seguindo o fluxo original descrito na seção preservada abaixo, sem ampliar o escopo funcional deste PR.

Visão

A padronização melhora a revisão, reduz ruído e evita deriva de formatação entre PRs abertos.

Test Plan

  • Veja a descrição original preservada abaixo para detalhes de validação, testes e notas de verificação.
Original body

What does this PR do?

Summary

detect_audio_environment() unconditionally added a hard warning when running inside a Docker/Podman container, blocking /voice on even when the host PulseAudio/PipeWire socket was correctly mounted and sounddevice could enumerate devices (issue #21203).

Fix

Mirror the existing WSL/PulseAudio handling at tools/voice_mode.py:110-125:

  • If is_container() and PULSE_SERVER or PIPEWIRE_REMOTE is set → downgrade to an informational notices entry (does not block voice).
  • If is_container() and neither is set → keep the hard block, but extend the message with the exact -v / -e flags users need.

No public surface changes. detect_audio_environment() still returns {available, warnings, notices}.

Test plan

  • 3 new regression tests in tests/tools/test_voice_mode.py::TestDetectAudioEnvironment:
    • test_docker_with_pulse_server_allows_voice
    • test_docker_with_pipewire_remote_allows_voice
    • test_docker_without_audio_forwarding_blocks_voice
  • Stash-verified: all 3 fail on origin/main, pass with the fix.
  • Full file tests/tools/test_voice_mode.py: 63/63 pass.

Closes #21203

Solution Sketch

  • fix the root cause in the touched subsystem instead of layering a broad workaround around the symptom
  • keep surrounding behavior stable and avoid unrelated refactors while the area is under review
  • prove the change with focused checks on the exact path that regressed

Related Issue

Closes #21203

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • preserved the existing technical rationale and validation notes inside the template body
  • scoped this PR description to the implementation already present on the branch
  • aligned the delivery format with .github/PULL_REQUEST_TEMPLATE.md

How to Test

  1. Review the existing validation notes preserved in this PR body.
  2. Run the focused checks for the touched area.
  3. Confirm the scoped change still behaves as described above.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform:

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • N/A.

Generated by Hermes Turbo


Generated by Hermes Turbo

…earch#21203)

detect_audio_environment() unconditionally added a hard warning when
running inside a container, blocking /voice on even when the host audio
socket was correctly forwarded (PulseAudio or PipeWire) and sounddevice
could enumerate devices.

Mirror the existing WSL/PulseAudio handling: if PULSE_SERVER or
PIPEWIRE_REMOTE is set, downgrade to a notice and let the audio backend
decide.  When neither is set, keep the block but extend the message with
the exact -v / -e flags users need.

Closes NousResearch#21203
Copilot AI review requested due to automatic review settings May 9, 2026 11:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes voice-mode environment detection inside Docker/Podman containers so /voice on is not blocked when host PulseAudio/PipeWire forwarding is configured via PULSE_SERVER and/or PIPEWIRE_REMOTE (issue #21203).

Changes:

  • Downgrade the container warning to an informational notice when PULSE_SERVER or PIPEWIRE_REMOTE is set.
  • Keep the hard block when running in a container without audio forwarding, and extend the warning with suggested Docker flags.
  • Add 3 regression tests covering container scenarios with/without forwarding.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
tools/voice_mode.py Adjusts container detection messaging/behavior to allow voice when audio forwarding env vars are present.
tests/tools/test_voice_mode.py Adds regression tests for Docker container audio forwarding scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/voice_mode.py Outdated
Comment thread tools/voice_mode.py Outdated
Comment on lines +233 to +236
assert result["available"] is True
assert result["warnings"] == []
assert any("Docker" in n for n in result.get("notices", []))

Comment on lines +251 to +254
assert result["available"] is True
assert result["warnings"] == []
assert any("Docker" in n for n in result.get("notices", []))

Comment thread tools/voice_mode.py Outdated
@alt-glitch alt-glitch added type/bug Something isn't working area/docker Docker image, Compose, packaging tool/tts Text-to-speech and transcription P2 Medium — degraded but workaround exists labels May 11, 2026
@benbarclay benbarclay merged commit 81a4f28 into NousResearch:main May 27, 2026
10 of 13 checks passed
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…mode-docker-respect-pulse-pipewire

fix(voice): honor PULSE_SERVER/PIPEWIRE_REMOTE inside Docker (NousResearch#21203)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docker Docker image, Compose, packaging P2 Medium — degraded but workaround exists tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: no audio device error in hermes chat

4 participants