story-kit: merge 149_bug_web_ui_does_not_update_when_agents_are_started_or_stopped
This commit is contained in:
@@ -55,15 +55,16 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
|
||||
let workflow = Arc::new(std::sync::Mutex::new(WorkflowState::default()));
|
||||
let port = resolve_port();
|
||||
let agents = Arc::new(AgentPool::new(port));
|
||||
|
||||
// Filesystem watcher: broadcast channel for work/ pipeline changes.
|
||||
// Created before AgentPool so the pool can emit AgentStateChanged events.
|
||||
let (watcher_tx, _) = broadcast::channel::<io::watcher::WatcherEvent>(1024);
|
||||
let agents = Arc::new(AgentPool::new(port, watcher_tx.clone()));
|
||||
|
||||
// Start the background watchdog that detects and cleans up orphaned Running agents.
|
||||
// When orphans are found, auto-assign is triggered to reassign free agents.
|
||||
let watchdog_root: Option<PathBuf> = app_state.project_root.lock().unwrap().clone();
|
||||
AgentPool::spawn_watchdog(Arc::clone(&agents), watchdog_root);
|
||||
|
||||
// Filesystem watcher: broadcast channel for work/ pipeline changes.
|
||||
let (watcher_tx, _) = broadcast::channel::<io::watcher::WatcherEvent>(1024);
|
||||
if let Some(ref root) = *app_state.project_root.lock().unwrap() {
|
||||
let work_dir = root.join(".story_kit").join("work");
|
||||
if work_dir.is_dir() {
|
||||
|
||||
Reference in New Issue
Block a user