huskies: merge 958

This commit is contained in:
dave
2026-05-13 11:47:27 +00:00
parent 8b53e20ca9
commit 28338a8e8d
7 changed files with 103 additions and 31 deletions
+6 -7
View File
@@ -5,7 +5,6 @@ use crate::agents::{AgentPool, ReconciliationEvent};
use crate::config;
use crate::gateway_relay;
use crate::io;
use crate::pipeline_state;
use crate::service;
use crate::service::status::StatusBroadcaster;
use std::path::PathBuf;
@@ -58,18 +57,18 @@ pub(crate) fn spawn_event_bridges(
}
}
// Auto-assign: trigger `auto_assign_available_work` whenever a work item
// enters an active pipeline stage (2_current/, 3_qa/, 4_merge/).
// Auto-assign: trigger `auto_assign_available_work` on every work-item
// CRDT state-transition event. auto_assign_available_work is idempotent
// and noops where there is nothing to do, so firing on every transition
// ensures that MergeFailure and other non-"active" stages are covered
// without any per-stage special-casing.
if let Some(root) = project_root {
let watcher_auto_rx = watcher_tx.subscribe();
let watcher_auto_agents = Arc::clone(&agents);
tokio::spawn(async move {
let mut rx = watcher_auto_rx;
while let Ok(event) = rx.recv().await {
if let io::watcher::WatcherEvent::WorkItem { ref stage, .. } = event
&& pipeline_state::Stage::from_dir(stage.as_str())
.is_some_and(|s| s.is_active())
{
if let io::watcher::WatcherEvent::WorkItem { ref stage, .. } = event {
crate::slog!(
"[auto-assign] CRDT transition detected in {stage}/; \
triggering auto-assign."