## Why
Closing the client WebSocket does not guarantee that the server has finished
detaching its session, so an immediate resume attempt can race with cleanup.
## What changed
- Keep the test process alive through piped stdin instead of a fixed sleep.
- Retry session initialization when the server reports that the session is still
attached, with a five-second timeout.
- Surface unexpected JSON-RPC errors with their response details.
GitOrigin-RevId: 1f5c2bf21719365262e6fa9f4c21e7c3f81a5729