From 9dbc2c3199047609a9f8496fec07ecdb10aee73d Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 18 Jan 2026 18:55:04 +0000 Subject: Add pushed heartbeats and multi-question select --- makima/src/server/handlers/mesh_supervisor.rs | 9 +++++++++ makima/src/server/state.rs | 9 +++++++++ 2 files changed, 18 insertions(+) (limited to 'makima/src/server') diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs index 8c7ecb5..a8af3fb 100644 --- a/makima/src/server/handlers/mesh_supervisor.rs +++ b/makima/src/server/handlers/mesh_supervisor.rs @@ -73,6 +73,9 @@ pub struct AskQuestionRequest { /// When true, the request will block indefinitely until user responds (no timeout) #[serde(default)] pub phaseguard: bool, + /// When true, allow selecting multiple choices (response will be comma-separated) + #[serde(default)] + pub multi_select: bool, } fn default_question_timeout() -> i32 { @@ -118,6 +121,9 @@ pub struct PendingQuestionSummary { pub choices: Vec, pub context: Option, pub created_at: chrono::DateTime, + /// Whether multiple choices can be selected + #[serde(default)] + pub multi_select: bool, } /// Request to create a checkpoint. @@ -1521,6 +1527,7 @@ pub async fn ask_question( request.question.clone(), request.choices.clone(), request.context.clone(), + request.multi_select, ); // Broadcast question as task output entry for the task's chat @@ -1528,6 +1535,7 @@ pub async fn ask_question( "question_id": question_id.to_string(), "choices": request.choices, "context": request.context, + "multi_select": request.multi_select, }); state.broadcast_task_output(TaskOutputNotification { task_id: supervisor_id, @@ -1631,6 +1639,7 @@ pub async fn list_pending_questions( choices: q.choices, context: q.context, created_at: q.created_at, + multi_select: q.multi_select, }) .collect(); diff --git a/makima/src/server/state.rs b/makima/src/server/state.rs index d022834..86f38c8 100644 --- a/makima/src/server/state.rs +++ b/makima/src/server/state.rs @@ -128,6 +128,9 @@ pub struct SupervisorQuestionNotification { pub pending: bool, /// When the question was asked pub created_at: chrono::DateTime, + /// Whether multiple choices can be selected + #[serde(default)] + pub multi_select: bool, } /// Stored supervisor question for persistence @@ -141,6 +144,8 @@ pub struct PendingSupervisorQuestion { pub choices: Vec, pub context: Option, pub created_at: chrono::DateTime, + /// Whether multiple choices can be selected + pub multi_select: bool, } /// Response to a supervisor question @@ -654,6 +659,7 @@ impl AppState { question: String, choices: Vec, context: Option, + multi_select: bool, ) -> Uuid { let question_id = Uuid::new_v4(); let now = chrono::Utc::now(); @@ -670,6 +676,7 @@ impl AppState { choices: choices.clone(), context: context.clone(), created_at: now, + multi_select, }, ); @@ -684,6 +691,7 @@ impl AppState { context, pending: true, created_at: now, + multi_select, }); tracing::info!( @@ -742,6 +750,7 @@ impl AppState { context: question.1.context, pending: false, created_at: question.1.created_at, + multi_select: question.1.multi_select, }); tracing::info!( -- cgit v1.2.3