fix(mobile): improve tunnel stability and user experience - #12
Merged
vaaandark merged 1 commit intoMar 18, 2026
Merged
Conversation
- Redirect tunnel subprocess stderr to ~/.ags/tunnel-<id>.log instead of parent terminal, preventing background reconnection logs from polluting the user's shell. Display log path after successful connect. - Add max consecutive dial failure limit (5) to stop infinite reconnection when sandbox is deleted or token expired (bad handshake). - Disconnect old adb address before cleanup when reconnecting the same sandbox, preventing stale offline devices in adb. - Wait 2s after adb connect for ADB protocol handshake to complete, avoiding "error: closed" on the first user command. Cannot use get-state/shell probes because each adb command opens a new TCP connection through the tunnel, triggering server-side preemption. - Remove net.Dial port probe from mobile list — each TCP connection to the tunnel opens a new WebSocket and preempts the active ADB session. Rely on PID-based zombie detection in store.List() instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Redirect tunnel subprocess stderr to ~/.ags/tunnel-.log instead of parent terminal, preventing background reconnection logs from polluting the user's shell. Display log path after successful connect.
Add max consecutive dial failure limit (5) to stop infinite reconnection when sandbox is deleted or token expired (bad handshake).
Disconnect old adb address before cleanup when reconnecting the same sandbox, preventing stale offline devices in adb.
Wait 2s after adb connect for ADB protocol handshake to complete, avoiding "error: closed" on the first user command. Cannot use get-state/shell probes because each adb command opens a new TCP connection through the tunnel, triggering server-side preemption.
Remove net.Dial port probe from mobile list — each TCP connection to the tunnel opens a new WebSocket and preempts the active ADB session. Rely on PID-based zombie detection in store.List() instead.