Summary
Startup reconciliation (packages/worker/src/index.ts:86) is meant to clean up orphaned build containers after a worker crash, but it can never match anything.
Evidence
listManaged() (packages/worker/src/infrastructure/docker/docker-runner.ts:566) only includes containers whose labels contain shipyard.deployment-id (line 575).
- Neither caller sets that label:
strategies/nixpacks.ts:335 sets only shipyard.managed/type/app-id/worker-id.
strategies/dockerfile.ts:184 sets the same four labels, no deployment-id.
Result: listManaged() always returns [], so reconcileStartup() never cleans up orphaned build containers after a worker restart.
Fix
Set "shipyard.deployment-id": deploymentId in the labels passed to runLongLived() in both strategies. Smallest fix in the codebase.
Summary
Startup reconciliation (
packages/worker/src/index.ts:86) is meant to clean up orphaned build containers after a worker crash, but it can never match anything.Evidence
listManaged()(packages/worker/src/infrastructure/docker/docker-runner.ts:566) only includes containers whose labels containshipyard.deployment-id(line 575).strategies/nixpacks.ts:335sets onlyshipyard.managed/type/app-id/worker-id.strategies/dockerfile.ts:184sets the same four labels, no deployment-id.Result:
listManaged()always returns[], soreconcileStartup()never cleans up orphaned build containers after a worker restart.Fix
Set
"shipyard.deployment-id": deploymentIdin the labels passed torunLongLived()in both strategies. Smallest fix in the codebase.