mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-11 10:23:17 +08:00
AssignWorkerStep starts a background goroutine to release a stale worker assignment. It builds its context from the request ctx, but that ctx is cancelled right after the workflow returns (releaseLock runs on defer). If the goroutine has not called UpdateWorker yet, the call fails with a cancelled context and the worker keeps the stale assignment forever. Nothing else clears it while the pod is alive. Fix: use context.Background() for the release call, same pattern used in cmd/atenet/internal/router/resumer.go. Tested with go test ./cmd/ateapi/internal/controlapi/...