Skip to content

fix(cli): remove return from voice finally block#23654

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/21088-voice-finally
Open

fix(cli): remove return from voice finally block#23654
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/21088-voice-finally

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the return from the finally block in Hermes voice cleanup so Python 3.14+ no longer emits a SyntaxWarning, while preserving the existing continuous-voice restart behavior.

Related Issue

Fixes #21088

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

  • restructure /Users/leongong/Desktop/LeonProjects/worktrees/hermes-agent/hermes-21088-voice-finally/cli.py so post-cleanup voice restart logic runs after finally
  • replace the return in _voice_stop_and_transcribe with a stop_continuous flag that preserves the 3x no-speech stop rule
  • add an AST-based regression test in /Users/leongong/Desktop/LeonProjects/worktrees/hermes-agent/hermes-21088-voice-finally/tests/tools/test_voice_cli_integration.py to assert the finally block no longer contains a return

How to Test

  1. uv run --frozen --extra dev pytest -q -o addopts='' tests/tools/test_voice_cli_integration.py -k 'voice_stop_and_transcribe_has_no_return_in_finally'
  2. PYTHONWARNINGS='error::SyntaxWarning' uv run --frozen python -m py_compile cli.py
  3. uv run --frozen ruff check cli.py tests/tools/test_voice_cli_integration.py

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: macOS 15

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

For New Skills

  • This skill is broadly useful to most users (if bundled) — see Contributing Guide
  • SKILL.md follows the standard format (frontmatter, trigger conditions, steps, pitfalls)
  • No external dependencies that aren't already available (prefer stdlib, curl, existing Hermes tools)
  • I've tested the skill end-to-end: hermes --toolsets skills -q "Use the X skill to do Y"

Screenshots / Logs

  • uv run --frozen --extra dev pytest -q -o addopts='' tests/tools/test_voice_cli_integration.py -k 'voice_stop_and_transcribe_has_no_return_in_finally' -> 1 passed
  • PYTHONWARNINGS='error::SyntaxWarning' uv run --frozen python -m py_compile cli.py -> passed
  • uv run --frozen ruff check cli.py tests/tools/test_voice_cli_integration.py -> All checks passed!

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have labels May 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #21100 — same fix removing return-in-finally from _voice_stop_and_transcribe to silence Python 3.14+ SyntaxWarning. Also competes with #21261.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SyntaxWarning: return in finally block in _voice_process_recording (Python 3.14+)

2 participants