diff options
| author | soryu <soryu@soryu.co> | 2026-02-20 00:46:21 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-20 00:46:21 +0000 |
| commit | aa974c4888851f10c782e07b9d9bff7a6f1aef15 (patch) | |
| tree | b1cd40dedeaff64fe447fdd9c6c1000870b6a536 /makima/src/server | |
| parent | ed84d7ec5ece272a2cb8dabd36cbd6074df0887e (diff) | |
| download | soryu-aa974c4888851f10c782e07b9d9bff7a6f1aef15.tar.gz soryu-aa974c4888851f10c782e07b9d9bff7a6f1aef15.zip | |
fix: reconcile:on blocking, pending question notifications, and infra improvements (#73)
* feat: soryu-co/soryu - makima: Fix contracts page overflow - constrain layout to viewport height
* feat: soryu-co/soryu - makima: Add git fetch to create_worktree and improve completion prompt merge conflict handling
* WIP: heartbeat checkpoint
* feat: soryu-co/soryu - makima: Add pending question notification badge to directive sidebar and nav
* feat: soryu-co/soryu - makima: Fix reconcile:on blocking - make phaseguard poll indefinitely instead of returning immediately
Diffstat (limited to 'makima/src/server')
| -rw-r--r-- | makima/src/server/handlers/mesh_supervisor.rs | 41 |
1 files changed, 8 insertions, 33 deletions
diff --git a/makima/src/server/handlers/mesh_supervisor.rs b/makima/src/server/handlers/mesh_supervisor.rs index 90c6dc7..0ea1a57 100644 --- a/makima/src/server/handlers/mesh_supervisor.rs +++ b/makima/src/server/handlers/mesh_supervisor.rs @@ -1807,42 +1807,17 @@ pub async fn ask_question( ).into_response(); } - // If phaseguard is enabled (or directive reconcile mode), pause the supervisor task and return - // The task will be auto-resumed when a message is sent to it (e.g., when user answers) + // Determine if we should block indefinitely (phaseguard or directive reconcile mode) let use_phaseguard = request.phaseguard || (is_directive_context && directive_reconcile_mode); - if use_phaseguard { - // Pause the supervisor task - if let Some(daemon_id) = supervisor.daemon_id { - let cmd = DaemonCommand::PauseTask { task_id: supervisor_id }; - if let Err(e) = state.send_daemon_command(daemon_id, cmd).await { - tracing::warn!(supervisor_id = %supervisor_id, error = %e, "Failed to pause supervisor for phaseguard"); - } else { - tracing::info!(supervisor_id = %supervisor_id, "Paused supervisor for phaseguard question"); - } - } - - // Update task status to paused in DB - let update = crate::db::models::UpdateTaskRequest { - status: Some("paused".to_string()), - ..Default::default() - }; - if let Err(e) = repository::update_task_for_owner(pool, supervisor_id, owner_id, update).await { - tracing::warn!(supervisor_id = %supervisor_id, error = %e, "Failed to update task status to paused"); - } - - return ( - StatusCode::OK, - Json(AskQuestionResponse { - question_id, - response: None, - timed_out: false, - }), - ).into_response(); - } // Poll for response with timeout - // For directive tasks without reconcile mode, use 30s default timeout - let timeout_secs = if is_directive_context && !directive_reconcile_mode { + // - Phaseguard: block indefinitely until user responds + // - Directive tasks without reconcile mode: 30s default timeout + // - Contract tasks: use requested timeout_seconds + let timeout_secs = if use_phaseguard { + // Block indefinitely until user responds + u64::MAX / 2 + } else if is_directive_context && !directive_reconcile_mode { 30 } else { request.timeout_seconds.max(1) as u64 |
