Route inbound realtime text into turn start or steer (#12469)

- Route inbound realtime websocket text into normal user input handling
so it steers an active turn or starts a new one
This commit is contained in:
Ahmed Ibrahim
2026-02-21 15:45:27 -08:00
committed by GitHub
Unverified
parent 2ba2c57af4
commit 031d701705
3 changed files with 350 additions and 17 deletions
+15
View File
@@ -1518,6 +1518,21 @@ impl Session {
format!("auto-compact-{id}")
}
pub(crate) async fn route_realtime_text_input(self: &Arc<Self>, text: String) {
handlers::user_input_or_turn(
self,
self.next_internal_sub_id(),
Op::UserInput {
items: vec![UserInput::Text {
text,
text_elements: Vec::new(),
}],
final_output_json_schema: None,
},
)
.await;
}
pub(crate) async fn get_total_token_usage(&self) -> i64 {
let state = self.state.lock().await;
state.get_total_token_usage(state.server_reasoning_included())