storkit: merge 421_story_timer_command_for_deferred_agent_start

This commit is contained in:
dave
2026-03-28 08:59:36 +00:00
parent 1ec9aaab8a
commit cf5424f9a6
7 changed files with 836 additions and 0 deletions
@@ -433,6 +433,29 @@ pub(super) async fn on_room_message(
return;
}
// Check for the timer command, which requires async file I/O and cannot
// be handled by the sync command registry.
if let Some(timer_cmd) = crate::chat::timer::extract_timer_command(
&user_message,
&ctx.bot_name,
ctx.bot_user_id.as_str(),
) {
slog!("[matrix-bot] Handling timer command from {sender}: {timer_cmd:?}");
let response = crate::chat::timer::handle_timer_command(
timer_cmd,
&ctx.timer_store,
&ctx.project_root,
)
.await;
let html = markdown_to_html(&response);
if let Ok(msg_id) = ctx.transport.send_message(&room_id_str, &response, &html).await
&& let Ok(event_id) = msg_id.parse()
{
ctx.bot_sent_event_ids.lock().await.insert(event_id);
}
return;
}
// Spawn a separate task so the Matrix sync loop is not blocked while we
// wait for the LLM response (which can take several seconds).
tokio::spawn(async move {