Skip to content

[build-tools] Supervise device session tunnels - #4526

Open
gwdp wants to merge 1 commit into
mainfrom
gwdp/supervise-device-session-tunnels
Open

gwdp wants to merge 1 commit into
mainfrom
gwdp/supervise-device-session-tunnels

Conversation

@gwdp

@gwdp gwdp commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Why

Recover a failed public tunnel without changing the session URL.

How

  • Check both local and public endpoints. Reopen the tunnel after repeated public failures while the local service is healthy.
  • Bound retries and wait times, and track listeners for shutdown cleanup.

Test Plan

  • Rebased onto main (6fe396e4) after the startup and egress changes landed; the net diff is unchanged. Claude Code ran the build-tools build, typecheck, oxfmt and oxlint on the changed files, and the session step/util tests (1894 passed, 8 skipped). CI passes on the new head.
  • Real ngrok SDK/service tested in an isolated Tart clone with HTTP/WebSocket fixtures and guest-only network faults. Normal traffic, backend failure, short interruption and long-outage recovery on the same URL passed.
  • One shutdown case failed: stop timed out after four seconds during a pending native reopen. The late replacement closed, but the old listener's failed close was never retried after network recovery. This remains unfixed; a live public endpoint leak was not established.

Earlier local launch E2E passed: Universe-generated steps through build-tools download/install/start to pinned serve-sim on a real iOS Simulator, checking one app start, arguments and deep link. Cloud calls used loopback adapters. This predates the current head; hosted recovery and real preview/controller reconnection remain unverified.

Authorship and LLM use

Gabe set the direction and reviewed every line of the final diff. Codex implemented tunnel supervision, iterated with AI reviews, and ran the local tests and Tart fault checks.

@gwdp

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as outdated.

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.95376% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.36%. Comparing base (53ac936) to head (6fe396e).

Files with missing lines Patch % Lines
...ackages/build-tools/src/steps/utils/ngrokTunnel.ts 95.91% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4526      +/-   ##
==========================================
+ Coverage   75.30%   75.36%   +0.07%     
==========================================
  Files        1053     1054       +1     
  Lines       52170    52323     +153     
  Branches    11356    11427      +71     
==========================================
+ Hits        39281    39430     +149     
- Misses      11901    11904       +3     
- Partials      988      989       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gwdp

This comment has been minimized.

@linear-code

linear-code Bot commented Oct 3, 2026

Copy link
Copy Markdown

ENG-26486

@gwdp

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 6bb585d to f877d5c Compare October 6, 2026 00:00
@gwdp
gwdp changed the base branch from main to gwdp/serve-sim-agent-device-boot October 6, 2026 00:01
@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from f877d5c to db96f6e Compare October 6, 2026 00:02
@gwdp

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from db96f6e to 27e7359 Compare October 6, 2026 01:35
@gwdp

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 27e7359 to 3efe2f7 Compare October 9, 2026 09:12
@gwdp

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 3efe2f7 to 3f3aa2d Compare October 9, 2026 19:49
@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 3f3aa2d to f28c5be Compare October 10, 2026 00:25
@gwdp
gwdp added this pull request to stack #4599 October 10, 2026 00:26
@gwdp
gwdp removed this pull request from stack #4599 October 10, 2026 08:38
@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from f28c5be to f7d6759 Compare October 10, 2026 08:40
@gwdp
gwdp changed the base branch from gwdp/serve-sim-agent-device-boot to gwdp/serve-sim-capture-egress-handoff October 10, 2026 08:40
@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch 3 times, most recently from c07a149 to 61b6908 Compare October 15, 2026 16:20
@gwdp

gwdp commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex contribution: implemented tunnel supervision and its cleanup handling, then restacked this layer under Gabe's direction. Updated the description with the exact-head CI/local results and real-ngrok Tart fault evidence, including the unfixed shutdown race. Gabe reviewed every line of the final diff.

— Codex

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 61b6908 to 8c68361 Compare October 15, 2026 16:28
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 8c68361 to 4c2f3a7 Compare October 15, 2026 18:00
@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 4c2f3a7 to 698570c Compare October 15, 2026 18:24
@gwdp

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from 698570c to c1c6a75 Compare October 15, 2026 18:38
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from c1c6a75 to beb2e0f Compare October 15, 2026 19:26
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp requested a review from szdziedzic October 16, 2026 03:46
@gwdp
gwdp marked this pull request as ready for review October 16, 2026 03:46
@gwdp
gwdp removed this pull request from stack #4606 October 17, 2026 01:44
@gwdp
gwdp added this pull request to stack #4671 October 17, 2026 01:44
Base automatically changed from gwdp/serve-sim-capture-egress-handoff to main October 20, 2026 03:46
Co-Authored-By: GPT-6.1-Sol <noreply@openai.com>
@gwdp
gwdp force-pushed the gwdp/supervise-device-session-tunnels branch from beb2e0f to 6fe396e Compare October 20, 2026 04:55
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

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.

1 participant