ensure_started cancels a background re-attach instead of waiting for it, and every register bumps the project's generation, so a late re-attach can never replace a newer tunnel. A task StopTask refused after a failed start keeps its ARN. A re-attach that gives up clears the pending flag only if still current; close_if_task checks and takes under one lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>