story-kit: merge 94_bug_stale_agent_state_persists_after_server_restart
This commit is contained in:
@@ -78,11 +78,19 @@ async fn main() -> Result<(), std::io::Error> {
|
||||
|
||||
let app = build_routes(ctx);
|
||||
|
||||
// On startup, auto-assign free agents to any work already queued in the
|
||||
// active pipeline stages (2_current/, 3_qa/, 4_merge/).
|
||||
// On startup:
|
||||
// 1. Reconcile any stories whose agent work was committed while the server was
|
||||
// offline (worktree has commits ahead of master but pipeline didn't advance).
|
||||
// 2. Auto-assign free agents to remaining unassigned work in the pipeline.
|
||||
if let Some(root) = startup_root {
|
||||
tokio::spawn(async move {
|
||||
eprintln!("[auto-assign] Server startup: scanning pipeline stages for unassigned work.");
|
||||
eprintln!(
|
||||
"[startup] Reconciling completed worktrees from previous session."
|
||||
);
|
||||
startup_agents.reconcile_on_startup(&root).await;
|
||||
eprintln!(
|
||||
"[auto-assign] Scanning pipeline stages for unassigned work."
|
||||
);
|
||||
startup_agents.auto_assign_available_work(&root).await;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user