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
+13 -3
View File
@@ -41,8 +41,13 @@ pub(super) async fn scan_and_claim(
};
for item in &items {
// Only claim stories in active stages.
if !item.stage().is_active() {
// Only claim stories in execution stages (Coding, Qa, Merge).
if !matches!(
item.stage(),
crate::pipeline_state::Stage::Coding
| crate::pipeline_state::Stage::Qa
| crate::pipeline_state::Stage::Merge { .. }
) {
continue;
}
@@ -163,7 +168,12 @@ pub(super) fn reclaim_timed_out_work(_project_root: &Path) {
let now = chrono::Utc::now().timestamp() as f64;
for item in &items {
if !item.stage().is_active() {
if !matches!(
item.stage(),
crate::pipeline_state::Stage::Coding
| crate::pipeline_state::Stage::Qa
| crate::pipeline_state::Stage::Merge { .. }
) {
continue;
}
+2 -5
View File
@@ -123,7 +123,7 @@ pub async fn run(
}
}
// Subscribe to watcher events to trigger auto-assign on stage transitions.
// Subscribe to watcher events to trigger auto-assign on every stage transition.
{
let auto_rx = watcher_tx.subscribe();
let auto_agents = Arc::clone(&agents);
@@ -131,10 +131,7 @@ pub async fn run(
tokio::spawn(async move {
let mut rx = auto_rx;
while let Ok(event) = rx.recv().await {
if let watcher::WatcherEvent::WorkItem { ref stage, .. } = event
&& crate::pipeline_state::Stage::from_dir(stage.as_str())
.is_some_and(|s| s.is_active())
{
if let watcher::WatcherEvent::WorkItem { ref stage, .. } = event {
slog!("[agent-mode] CRDT transition in {stage}/; triggering auto-assign.");
auto_agents.auto_assign_available_work(&auto_root).await;
}