zeroclaw/.github
Argenis 86ad0c6a2b
fix(channels): address critical bugs in voice wake word detection (#4191)
* feat(channels): add voice wake word detection channel

Add VoiceWakeChannel behind the `voice-wake` feature flag that:
- Captures audio from the default microphone via cpal
- Uses energy-based VAD to detect speech activity
- Transcribes speech via the existing transcription API (Whisper)
- Checks for a configurable wake word in the transcription
- On detection, captures the following utterance and dispatches it
  as a ChannelMessage

State machine: Listening -> Triggered -> Capturing -> Processing -> Listening

Config keys (under [channels_config.voice_wake]):
- wake_word (default: "hey zeroclaw")
- silence_timeout_ms (default: 2000)
- energy_threshold (default: 0.01)
- max_capture_secs (default: 30)

Includes tests for config parsing, state machine, RMS energy
computation, and WAV encoding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(config): fix pre-existing test compilation errors in schema.rs

- Remove #[cfg(unix)] gate on `use tempfile::TempDir` import since
  TempDir is used unconditionally in bootstrap file tests
- Add explicit type annotations on tokio::fs::* calls to resolve
  type inference failures (create_dir_all, write, read_to_string)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(channels): exclude voice-wake from all-features CI check

Add a `ci-all` meta-feature in Cargo.toml that includes every feature
except `voice-wake`, which requires `libasound2-dev` (ALSA) not present
on CI runners. Update the check-all-features CI job to use
`--features ci-all` instead of `--all-features`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(channels): address critical bugs in voice wake word detection

- Replace std::mem::forget(stream) with dedicated thread that holds the
  cpal stream and shuts down cleanly via oneshot channel, preventing
  microphone resource leaks on task cancellation
- Add config validation: energy_threshold must be positive+finite,
  silence_timeout_ms >= 100ms, max_capture_secs clamped to 300
- Guard WAV encoding against u32 overflow for large audio buffers
- Add hard cap on capture_buf size to prevent unbounded memory growth
- Increase audio channel buffer from 4 to 64 slots to reduce chunk
  drops during transcription API calls
- Remove dead WakeState::Processing variant that was never entered

---------

Co-authored-by: Giulio V <vannini.gv@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 20:43:19 -04:00
..
assets feat(channels): add show_tool_calls config to suppress tool notifications (#3480) 2026-03-14 09:49:35 -04:00
codeql Standardize security workflow and enhance CodeQL analysis (#479) 2026-02-17 00:10:46 -05:00
ISSUE_TEMPLATE fix(docs): remove stale onboarding flags after CLI changes (#3516) 2026-03-14 17:54:14 -04:00
workflows fix(channels): address critical bugs in voice wake word detection (#4191) 2026-03-21 20:43:19 -04:00
actionlint.yaml chore(ci): externalize workflow scripts and relocate main flow doc (#722) 2026-02-17 19:48:37 -05:00
CODEOWNERS chore(github): update review ownership routing (#3216) 2026-03-11 19:11:53 -04:00
dependabot.yml chore: update .gitignore, CODEOWNERS, and dependabot configuration 2026-03-07 21:05:23 -05:00
label-policy.json ci(workflows): consolidate policy and rust workflow setup (#564) 2026-02-17 11:35:20 -05:00
labeler.yml docs: strengthen collaboration governance and AGENTS engineering protocol (#263) 2026-02-16 05:59:04 -05:00
pull_request_template.md chore: migrate to single master branch model and update maintainers 2026-03-06 13:01:32 -05:00