Skip to content

[build-tools] Let serve-sim start the iOS Simulator for web preview - #4601

Merged
gwdp merged 4 commits into
gwdp/serve-sim-startup-implementationfrom
gwdp/serve-sim-web-preview-startup
Oct 15, 2026
Merged

gwdp merged 4 commits into
gwdp/serve-sim-startup-implementationfrom
gwdp/serve-sim-web-preview-startup

Conversation

@gwdp

@gwdp gwdp commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Why

Give web preview one owner for starting the Simulator and app, including the egress guard.

How

  • Start serve-sim on the selected Simulator, check the guard, then request app install and launch through its authenticated API. Keep launch arguments and the deep link.
  • Keep startup deadlines, push-service setup and cleanup in the session host. The new startup path stays inactive until Universe server/www sends the new workflow inputs; merging this PR alone does not move boot/install/launch ownership. Existing www-generated workflows retain their boot/install steps and serve-sim launch flags; Android keeps its existing device-startup path.

Shared host changes also make web-preview startup cancellable, explicitly set iOS temporary/state directories and refine readiness errors. Xcode selection happens before input validation.

Release serve-sim with the app-control API before deploying the worker, then enable the new workflow inputs in Universe server/www.

Test Plan

  • Previous CI passed on b5c7013, including Node 20/22/24 and the egress-guard check. The earlier Devin review had a successful status; its final report was still pending when checked.
  • Restacked to inherit [build-tools] Add serve-sim Simulator startup helpers #4605’s test-only coverage follow-up. Runtime code is unchanged. Codex ran 294 focused startup/action tests and TypeScript at the tip; fresh CI is pending.
  • Codex ran 86 focused tests at this layer and 256 across the restacked startup callers/actions. Both readiness-failure regressions failed before the fix and pass now; legacy-workflow compatibility passes. TypeScript passed here and at the stack tip; lint and formatting passed.
  • Earlier local launch E2E passed: Universe-generated steps through build-tools download/install/start to pinned serve-sim on a real iOS Simulator. Verified one app start, arguments and deep link. Cloud calls used loopback adapters; hosted and current-head device runs remain pending.

Earlier web-preview timing

Main Earlier startup implementation Saving Sample
52.4s 39.8s 12.6s (~24%) One pair on d13f4ed5

This is the earlier local Tart result, from worker entry to session reporting with a stopped Simulator, cached packages and loopback cloud adapters. It is not a measurement of the current head. The new controlled comparison covered agent-device, Argent and Appium; web preview has not been remeasured. Hosted dispatch and worker allocation were not measured.

Authorship and LLM use

Gabe wrote the initial implementation and guided the design. Codex implemented and split the changes. AI review led to fixes for startup order and cleanup. Gabe reviewed the final code through eb9afe1, including this web-preview layer. Fresh Devin review then found that readiness failure could leave startup waiting for control state. Codex fixed failure propagation and added regressions for control-state and download waits. Gabe reviewed this follow-up.

@gwdp
gwdp added this pull request to stack #4604 October 10, 2026 08:40
@gwdp

This comment has been minimized.

@codecov

codecov Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.01709% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.60%. Comparing base (6026bec) to head (c1588a3).

Files with missing lines Patch % Lines
...s/build-tools/src/steps/utils/deviceSessionHost.ts 93.58% 7 Missing ⚠️
Additional details and impacted files
@@                            Coverage Diff                            @@
##           gwdp/serve-sim-startup-implementation    #4601      +/-   ##
=========================================================================
+ Coverage                                  74.55%   74.60%   +0.05%     
=========================================================================
  Files                                       1032     1032              
  Lines                                      50538    50642     +104     
  Branches                                   10929    10969      +40     
=========================================================================
+ Hits                                       37673    37774     +101     
- Misses                                     11875    11878       +3     
  Partials                                     990      990              

☔ 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 gwdp changed the title [build-tools] Let serve-sim start iOS web-preview sessions [build-tools] Let serve-sim start the iOS Simulator for web preview Oct 10, 2026
@gwdp
gwdp force-pushed the gwdp/serve-sim-web-preview-startup branch from 1472479 to bd08790 Compare October 10, 2026 16:25
@gwdp

This comment has been minimized.

@gwdp

gwdp commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex implemented and simplified the startup path under Gabe's direction, including the readiness-failure fix. Gabe's review through eb9afe1 predates that fix and the new coverage tests.

Restacked at fb05693 to inherit #4605's test-only follow-up. Range-diff confirms this layer's patch and all runtime code are unchanged. The tip's 294 startup/action tests and TypeScript check pass; new CI is pending. No new device, hosted or human-review evidence is claimed.

Ready for Szymon (szdziedzic) as reviewer, with no assignee, as Gabe requested. The description retains the Universe server/www activation boundary and separately documented shared-host changes.

— Codex

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as resolved.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp marked this pull request as ready for review October 10, 2026 19:50
@gwdp
gwdp requested a review from szdziedzic October 10, 2026 19:50
@gwdp
gwdp force-pushed the gwdp/serve-sim-web-preview-startup branch from b5c7013 to fb05693 Compare October 10, 2026 20:06
@douglowder

Copy link
Copy Markdown
Contributor

eas-cli now uses changesets for changelogs (#4580). The required "Check for a changeset" check fails on PRs that edit CHANGELOG.md.

To update this PR:

  1. Revert the changes to CHANGELOG.md.
  2. Run yarn changeset, select the changed packages and the bump type, and write the summary.
  3. Commit the new file in .changeset/.

The release adds the PR link and the author to the entry. If this PR needs no changelog entry, revert the CHANGELOG.md changes and add the "no changelog" label.

@gwdp

gwdp commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased this layer onto gwdp/serve-sim-startup-implementation and moved its release note from CHANGELOG.md into its own changeset. Current-main behavior was preserved.

Validation: focused build-tools tests, changeset validation, changed-file lint/format and build-tools typecheck passed. No new native or hosted acceptance was run for this restack.

Published head: 68c900a42b933bc2cb6efbafae22ab3ff34df176.

— Codex

@gwdp
gwdp force-pushed the gwdp/serve-sim-web-preview-startup branch 3 times, most recently from 2834398 to 038cf0f Compare October 15, 2026 05:09
@gwdp
gwdp force-pushed the gwdp/serve-sim-web-preview-startup branch from 038cf0f to c1588a3 Compare October 15, 2026 16:20
@gwdp

gwdp commented Oct 15, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and resolved the shared-host conflict, preserving Android preview authentication and the iOS startup token/custom state directory. The upper stack is restacked too. Local validation: 355 focused tests, build-tools typecheck, resolved-file lint/format, and independent source review passed. Fresh CI is pending.

— Codex

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

@gwdp
gwdp merged commit 3e00e86 into main Oct 15, 2026
12 checks passed
@gwdp
gwdp deleted the gwdp/serve-sim-web-preview-startup branch October 15, 2026 16:28
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.

3 participants