fix(coding-agent): enforce session ownership when joining an in-flight open (#1864)

* fix(coding-agent): wait for worker recovery before session reuse * fix(coding-agent): join overlapping worker starts * fix(coding-agent): enforce session ownership when joining an in-flight open Joining an opening worker via openingWorkers returned the pending worker to any client with the same session path, bypassing the ownership check that the settled path applies in reuseWorkerForCreate. Await the pending open and apply the shared owner check before returning; a rejected open still propagates its original error to joiners. * fix(coding-agent): rejoin an open registered during stale-worker reclaim The reclaimStaleWorkerRegistration await sits between the pending-open check and openingWorkers.set, so a concurrent opener registered during that await was overwritten and a second worker launched for the same saved session (regression from the #1756 reordering). Re-check the map after the reclaim await and join through the shared owner-checked path. * test(coding-agent): cover foreign-owner join at the post-reclaim re-check An intruder client joining the open registered during stale-worker reclaim must get SessionAlreadyActiveError; kills the mutant that returns the pending promise without the owner check.

5b6c0e94 parent 6322b7bb +138 −8
browse files