summaryrefslogtreecommitdiff
path: root/makima/src/orchestration/directive.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-02-16 01:24:19 +0000
committersoryu <soryu@soryu.co>2026-02-16 01:31:31 +0000
commit0676468e3e69ff36f1e509d775f191dd41f6080b (patch)
tree624fb2e69827299ae9e571240e53d226124f55dc /makima/src/orchestration/directive.rs
parenta9da99085bc0b1f94e13cb27639915fd1398ccbe (diff)
downloadsoryu-0676468e3e69ff36f1e509d775f191dd41f6080b.tar.gz
soryu-0676468e3e69ff36f1e509d775f191dd41f6080b.zip
Ensure directives replan on goal change
Diffstat (limited to 'makima/src/orchestration/directive.rs')
-rw-r--r--makima/src/orchestration/directive.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs
index 92aacde..9113fd4 100644
--- a/makima/src/orchestration/directive.rs
+++ b/makima/src/orchestration/directive.rs
@@ -382,6 +382,17 @@ impl DirectiveOrchestrator {
repository::assign_orchestrator_task(&self.pool, directive_id, task.id).await?;
+ // Cancel any old planning tasks for this directive (superseded by the new one)
+ let cancelled =
+ repository::cancel_old_planning_tasks(&self.pool, directive_id, task.id).await?;
+ if cancelled > 0 {
+ tracing::info!(
+ directive_id = %directive_id,
+ cancelled_count = cancelled,
+ "Cancelled old planning tasks superseded by new plan"
+ );
+ }
+
// Try to dispatch to a daemon
self.try_dispatch_task(task.id, owner_id, &task.name, &task.plan, task.version).await;