From 219bca168508e1ea5e91e8a9ce98338afeddfbd2 Mon Sep 17 00:00:00 2001 From: soryu Date: Sun, 18 Jan 2026 17:44:18 +0000 Subject: Add phaseguard flag for supervisor questions to wait indefinitely (#4) * Add phaseguard flag to supervisor ask command When phaseguard is enabled (--phaseguard flag), the supervisor's ask command will block indefinitely waiting for user response instead of timing out after the default 1 hour. This ensures that phase transitions requiring user confirmation cannot proceed without explicit approval. Changes: - Add phaseguard field to AskQuestionRequest in server handler - Add phaseguard field to AskQuestionRequest in API client - Add --phaseguard CLI flag to AskArgs - Update supervisor_ask() to accept phaseguard parameter - Modify ask_question handler to skip timeout check when phaseguard=true Co-Authored-By: Claude Opus 4.5 * Task completion checkpoint --------- Co-authored-by: Claude Opus 4.5 --- makima/src/server/handlers/mesh_supervisor.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'makima/src/server/handlers/mesh_supervisor.rs') diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs index 29eef81..8c7ecb5 100644 --- a/makima/src/server/handlers/mesh_supervisor.rs +++ b/makima/src/server/handlers/mesh_supervisor.rs @@ -70,6 +70,9 @@ pub struct AskQuestionRequest { /// How long to wait for a response (seconds) #[serde(default = "default_question_timeout")] pub timeout_seconds: i32, + /// When true, the request will block indefinitely until user responds (no timeout) + #[serde(default)] + pub phaseguard: bool, } fn default_question_timeout() -> i32 { @@ -1578,8 +1581,8 @@ pub async fn ask_question( ).into_response(); } - // Check timeout - if start.elapsed() >= timeout_duration { + // Check timeout (skip timeout if phaseguard is enabled - wait indefinitely) + if !request.phaseguard && start.elapsed() >= timeout_duration { // Remove the pending question on timeout state.remove_pending_question(question_id); -- cgit v1.2.3