Skip to content

[eas-cli] Keep simulator control connections alive - #4791

Open
gwdp wants to merge 1 commit into
mainfrom
gwdp/simulator-control-keep-alive
Open

gwdp wants to merge 1 commit into
mainfrom
gwdp/simulator-control-keep-alive

Conversation

@gwdp

@gwdp gwdp commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Why

Repeated control commands reconnect to the preview server. Let agents keep the connection ready between commands.

How

Add an optional local helper and share action preparation, uploads, downloads and execution. Ordinary control commands reuse the helper when available. The idle timeout defaults to 120 seconds.

eas simulator:control:connection open --idle-timeout 300
eas simulator:control appearance.set dark
eas simulator:control:connection status --id <session-id> --json
eas simulator:control:connection close

# Or keep the connection after an action:
eas simulator:control hardwareKeyboard.set off --keep-alive --idle-timeout 30

--idle-timeout takes seconds. Closing the connection leaves the simulator session running. Keep-alive supports macOS and Linux; ordinary commands still work on Windows. Control import (#4686) and start import (#4687) use this shared executor.

Security and cleanup

The helper uses an owned, private Unix socket directory. Processes running as the same OS user share this authority. Discovery is scoped to EAS credentials, project, session, API environment and CLI installation/version. Preview credentials pass over parent-child IPC; no new credential file is written.

Callers run one at a time. A dropped reply never triggers an automatic replay. Messages, queues and waits are bounded. Close finishes the in-flight action, rejects later actions and permits bounded upload cleanup. Immediate reopen waits for the drain.

Saved-login changes, idle expiry and remote disconnect close the helper. Server-side access-token revocation is not polled. An already-dispatched action can finish during shutdown.

Test Plan

Codex ran standalone control/helper tests, a clean package build, typecheck, lint and formatting. The complete stack passed 901 simulator/help tests across 35 suites. Node 22/24, GraphQL, changeset and coverage checks pass on this head. Devin completed; its import-scope note is addressed.

Codecov patch coverage is 94.57%. Worker bootstrap/exit paths and some error branches remain uncovered; no coverage exclusions were added. Hosted EAS session testing and latency measurements remain pending.

Authorship and LLM use

Gabe chose the connection commands and timeout, then asked to share the control code with imports. Codex implemented the helper, moved the action executor into this layer and restacked the imports. Gabe reviewed the final changes at 1899090.

Astra and Opus reviews led to removing redundant authentication and validation, then fixing admission and shutdown races. Devin identified the close/reopen race. Coverage reviews corrected a masked shutdown assertion and a fake-timer race. Independent rechecks were clean on the earlier combined implementation; Codex checked the reorganized layers and preserved feature tree. Those independent reviews and hosted testing were not repeated for the split.

— Codex

@gwdp

gwdp commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex implemented the optional connection helper, moved shared action execution into this layer and restacked the imports at Gabe’s request. Standalone checks and the complete 901-test stack passed; current-head CI and Devin review are complete. Gabe reviewed the final changes at 1899090. Hosted keep-alive QA and latency measurements remain pending.

— Codex

@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.56825% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.82%. Comparing base (16ed2a9) to head (1899090).

Files with missing lines Patch % Lines
...s/eas-cli/src/simulator/controlConnectionWorker.ts 78.37% 36 Missing and 1 partial ⚠️
packages/eas-cli/src/simulator/hostActions.ts 96.08% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4791      +/-   ##
==========================================
+ Coverage   76.61%   76.82%   +0.21%     
==========================================
  Files        1101     1107       +6     
  Lines       55355    55984     +629     
  Branches    12195    12340     +145     
==========================================
+ Hits        42406    43005     +599     
- Misses      11961    11990      +29     
- 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
gwdp force-pushed the gwdp/simulator-control-keep-alive branch from 7b3bbf9 to 04b5495 Compare October 30, 2026 01:15
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as outdated.

@gwdp
gwdp force-pushed the gwdp/simulator-control-keep-alive branch from 04b5495 to 5261e34 Compare October 30, 2026 01:33
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/simulator-control-keep-alive branch from 5261e34 to f2c3b5c Compare October 31, 2026 06:01
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp force-pushed the gwdp/simulator-control-keep-alive branch from f2c3b5c to 0de7ec0 Compare October 31, 2026 06:34
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp
gwdp changed the base branch from gwdp/start-import-second-20261018 to main November 3, 2026 04:27
@gwdp
gwdp force-pushed the gwdp/simulator-control-keep-alive branch from 0de7ec0 to 1899090 Compare November 3, 2026 04:27
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

@gwdp
gwdp added this pull request to stack #4804 November 3, 2026 04:33
@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

devin-ai-integration[bot]

This comment was marked as outdated.

@gwdp
gwdp marked this pull request as ready for review November 3, 2026 05:08
@gwdp
gwdp requested a review from szdziedzic November 3, 2026 05:08
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
packages/eas-cli/** @douglowder

Generated by CodeMention

Warning: The preamble and epilogue options in commentConfiguration are deprecated. Use template instead.

@linear-code

linear-code Bot commented Nov 3, 2026

Copy link
Copy Markdown

ENG-28817

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