story-kit: merge 117_story_show_startup_reconciliation_progress_in_ui

This commit is contained in:
Dave
2026-02-23 22:50:57 +00:00
parent e3d9813707
commit 85fddcb71a
7 changed files with 341 additions and 8 deletions

View File

@@ -66,12 +66,18 @@ async fn main() -> Result<(), std::io::Error> {
}
}
// Reconciliation progress channel: startup reconciliation → WebSocket clients.
let (reconciliation_tx, _) =
broadcast::channel::<agents::ReconciliationEvent>(64);
// Permission channel: MCP prompt_permission → WebSocket handler.
let (perm_tx, perm_rx) = tokio::sync::mpsc::unbounded_channel();
// Capture project root and agents Arc before ctx is consumed by build_routes.
// Capture project root, agents Arc, and reconciliation sender before ctx
// is consumed by build_routes.
let startup_root: Option<PathBuf> = app_state.project_root.lock().unwrap().clone();
let startup_agents = Arc::clone(&agents);
let startup_reconciliation_tx = reconciliation_tx.clone();
let ctx = AppContext {
state: app_state,
@@ -79,6 +85,7 @@ async fn main() -> Result<(), std::io::Error> {
workflow,
agents,
watcher_tx,
reconciliation_tx,
perm_tx,
perm_rx: Arc::new(tokio::sync::Mutex::new(perm_rx)),
};
@@ -94,7 +101,9 @@ async fn main() -> Result<(), std::io::Error> {
slog!(
"[startup] Reconciling completed worktrees from previous session."
);
startup_agents.reconcile_on_startup(&root).await;
startup_agents
.reconcile_on_startup(&root, &startup_reconciliation_tx)
.await;
slog!(
"[auto-assign] Scanning pipeline stages for unassigned work."
);