Reconcile queue state on startup, remove age-based staleness check
Publish Image / publish (push) Successful in 20s

On boot, query Coder for running workspaces and re-adopt them into the
active queue. This prevents 409 conflicts after restarts and ensures
callbacks still work for in-flight tasks.

On 409: only delete stopped/failed workspaces. Running workspaces are
adopted — never killed based on age.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Daniel Samson
2026-04-12 14:01:56 +01:00
co-authored by Claude Opus 4.6
parent 36c80458e0
commit ec0b012586
3 changed files with 69 additions and 12 deletions
+5
View File
@@ -84,6 +84,11 @@ if (maintenanceRepos.length > 0) {
// Start
// ---------------------------------------------------------------------------
// Reconcile queue state with Coder before accepting traffic
queue.reconcile().catch((err) =>
console.error("[startup] reconcile failed:", err),
);
serve({ fetch: app.fetch, port: config.port }, (info) => {
console.log(`SDLC Orchestrator listening on :${info.port} (concurrency: ${concurrency})`);
});