While writing TUI tests for opencode, I noticed that the onCleanup (solidjs) was only invoked when the process exited. This caused a lot of test flakiness because the components had event listeners that survived between tests.
I think that this kind of cleanup should be performed when the renderer is destroyed. I'll create a PoC PR.