Skip to content

fix(mobile): improve tunnel stability and user experience - #12

Merged
vaaandark merged 1 commit into
TencentCloudAgentRuntime:mainfrom
yuehua-s:fix/mobile-tunnel-stability
Mar 18, 2026
Merged

fix(mobile): improve tunnel stability and user experience#12
vaaandark merged 1 commit into
TencentCloudAgentRuntime:mainfrom
yuehua-s:fix/mobile-tunnel-stability

Conversation

@yuehua-s

Copy link
Copy Markdown
Contributor
  • 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.

- 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>
@vaaandark
vaaandark merged commit 3ff5e50 into TencentCloudAgentRuntime:main Mar 18, 2026
4 checks passed
@yuehua-s
yuehua-s deleted the fix/mobile-tunnel-stability branch March 18, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants