Use case
When a debug session's DevTools/Inspector connection drops — for example after the machine or simulator goes to sleep, a flaky network hiccup, or the DevTools tab being closed — the Inspector shows "Disconnected — Run a new debug session to reconnect." The only offered path is a full new debug session, even in cases where the underlying Dart VM Service is still alive and reachable.
Restarting the whole session is disruptive: it loses widget rebuild/inspector state, forces a fresh flutter run, and wastes time when the only thing that actually broke was the DevTools ↔ VM Service WebSocket, not the VM itself.
Proposal
Add a "Reconnect" action to the Inspector (and DevTools generally) that attempts to re-attach to the last-known VM Service URI before falling back to "run a new session."
Behavior:
On disconnect, retain the last VM Service URI (ws://127.0.0.1:PORT/TOKEN=/ws).
The "Reconnect" button calls vmServiceConnectUri(uri) with a short timeout and a getVM() liveness check.
If the connection succeeds → restore the Inspector session in place, no new flutter run needed.
If it fails (VM/token dead) → keep the current fallback message ("Run a new debug session to reconnect").
Use case
When a debug session's DevTools/Inspector connection drops — for example after the machine or simulator goes to sleep, a flaky network hiccup, or the DevTools tab being closed — the Inspector shows "Disconnected — Run a new debug session to reconnect." The only offered path is a full new debug session, even in cases where the underlying Dart VM Service is still alive and reachable.
Restarting the whole session is disruptive: it loses widget rebuild/inspector state, forces a fresh flutter run, and wastes time when the only thing that actually broke was the DevTools ↔ VM Service WebSocket, not the VM itself.
Proposal
Add a "Reconnect" action to the Inspector (and DevTools generally) that attempts to re-attach to the last-known VM Service URI before falling back to "run a new session."
Behavior:
On disconnect, retain the last VM Service URI (ws://127.0.0.1:PORT/TOKEN=/ws).
The "Reconnect" button calls vmServiceConnectUri(uri) with a short timeout and a getVM() liveness check.
If the connection succeeds → restore the Inspector session in place, no new flutter run needed.
If it fails (VM/token dead) → keep the current fallback message ("Run a new debug session to reconnect").