Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(voice): replace monolithic include with modular submodules

Steven Enamakelfaba9cc22b09
diff --git a/crates/openhuman-core/src/voice/realtime_harness.rs b/crates/openhuman-core/src/voice/realtime_harness.rs
index 71a34711a8..a18e7372f3 100644
--- a/crates/openhuman-core/src/voice/realtime_harness.rs
+++ b/crates/openhuman-core/src/voice/realtime_harness.rs
@@ -11,9 +11,33 @@
//! Approval-gate origin: **ExternalChannel** — the turn text is user speech
//! arriving over a channel, so `external_effect` tools route through the
//! audit-trail path rather than running with trusted-CLI semantics.
+//!
+//! ## Module layout
+//!
+//! - [`prompt`] — pure prompt extraction/classification helpers.
+//! - [`agent`] — building and running the per-turn voice orchestrator.
+//! - [`chat_delivery`] — delivering a deferred result/failure into chat, and
+//! the raw socket emit helpers.
+//! - [`turn_handler`] — the end-to-end turn handler that ties them together.
+
+mod agent;
+mod chat_delivery;
+mod prompt;
+mod turn_handler;
+
+pub use prompt::extract_prompt;
+pub use turn_handler::handle_voice_harness_turn;
+
+#[cfg(test)]
+use agent::VOICE_DIRECTIVE;
+#[cfg(test)]
+use prompt::{
+ is_answerable_prompt, is_content_free, messages_to_history_pairs, readback_payload,
+ should_arm_speak_back, spoken_delta, VOICE_READBACK_PREFIX,
+};
+#[cfg(test)]
+use turn_handler::next_handoff_line;
#[cfg(test)]
#[path = "realtime_harness_tests.rs"]
mod tests;
-include!("realtime_harness_part_01.rs");
-include!("realtime_harness_part_02.rs");