For anyone interested, I created GitHub - nonameplum/AsyncLifetime: Automatic lifetime management for Swift async sequences. Prevents retain cycles and ensures proper cleanup. with this free function withLifetime with extensive unit tests that show different behaviors with isolation inheritance/context/etc + differences between Swift 6.2 vs <6.2.
The package exposes as public api only the version that returns cancellable, similarly to Combine, to prevent wrong usage which might happen in edge cases mentioned in the repo and unit tests.