diff --git a/src/main.rs b/src/main.rs index 9f66700..afed561 100644 --- a/src/main.rs +++ b/src/main.rs @@ -638,7 +638,19 @@ async fn process_loop(state: Arc>, client: Client) { _ => None, }); - let docs = match invoke_claude(&room_id, &room_name, &timeline, seen_idx, &model).await { + // Tell the room we're "typing" while claude thinks. Best-effort; no + // hard fail if it doesn't go through. + if let Err(e) = room.typing_notice(true).await { + tracing::debug!(room = %room_id, "failed to send typing start: {e}"); + } + + let invoke_result = invoke_claude(&room_id, &room_name, &timeline, seen_idx, &model).await; + + if let Err(e) = room.typing_notice(false).await { + tracing::debug!(room = %room_id, "failed to send typing stop: {e}"); + } + + let docs = match invoke_result { Ok(d) => d, Err(e) => { tracing::error!(room = %room_id, "claude invocation failed: {e}");