Skip to content

[eas-cli] Add simulator:network-requests - #4546

Open
gwdp wants to merge 13 commits into
mainfrom
gwdp/simulator-network-requests-command
Open

gwdp wants to merge 13 commits into
mainfrom
gwdp/simulator-network-requests-command

Conversation

@gwdp

@gwdp gwdp commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Why

Inspect captured simulator requests and download the HAR from the CLI.

How

eas simulator:network-requests lists completed requests by start time, supports --follow and --json, and shows request details with --request-id 1. For a downloadable HAR after stop, start iOS with --network-capture --network-capture-recording (#4597).

Request numbers are scoped to one capture. Turning capture off and back on can reuse #1 for a different request in the same Simulator session. List and detail lookup read the full retained capture, including opted-in bodies. --limit caps output only. --follow replays up to 500 recent rows, then streams new completions.

Test Plan

Codex ran 1,051 Simulator tests. Hosted QA covered list, detail and HAR export. --follow replayed existing traffic, streamed new GETs, and printed three failed CONNECTs as status 0 before exiting cleanly on Ctrl-C. The rebased CLI also downloaded a stopped session’s HAR with all nine probe requests. The JSON fix passed 74 focused tests, including a test of the real serializer.

Current CLI output

Live requests from the hosted demo:

$ easd sim:network-requests --id "$LIVE_SID" --limit 6 --timestamp
2026-11-27T19:04:36.589Z  #19    GET     https://httpbin.org/more-missing/request-1  404  31.4ms
2026-11-27T19:04:36.590Z  #20    GET     https://httpbin.org/more-missing/request-2  404  33.6ms
2026-11-27T19:04:36.590Z  #21    GET     https://httpbin.org/more-missing/request-3  404  34.2ms
2026-11-27T19:04:41.588Z  #22    GET     https://httpbin.org/anything/more-ok-again/request-1  200  30.3ms
2026-11-27T19:04:41.588Z  #23    GET     https://httpbin.org/anything/more-ok-again/request-2  200  33.7ms
2026-11-27T19:04:41.589Z  #24    GET     https://httpbin.org/anything/more-ok-again/request-3  200  34.6ms

HAR download from the stopped session. The downloaded HAR contained nine requests.

$ easd sim:network-requests --id "$STOPPED_SID" --output ./capture.har --non-interactive
- Downloading session artifact
✔ Downloading session artifact
Saved Network capture (404F2659) to ./capture.har.

Authorship and LLM use

Gabe directed the change and reviewed dad070dbd. Claude implemented the command. Codex added stopped-session downloads and numbered request IDs, then fixed JSON output to retain explicit nulls after Gabe’s review.

— Codex

@gwdp
gwdp force-pushed the gwdp/simulator-network-requests-command branch 4 times, most recently from 3df5d07 to fba76cb Compare October 8, 2026 05:44
@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.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.89503% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.98%. Comparing base (17d8121) to head (0614b48).

Files with missing lines Patch % Lines
...eas-cli/src/commands/simulator/network-requests.ts 98.94% 1 Missing ⚠️
packages/eas-cli/src/simulator/networkRequests.ts 98.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4546      +/-   ##
==========================================
+ Coverage   77.91%   77.98%   +0.07%     
==========================================
  Files        1146     1148       +2     
  Lines       58697    58872     +175     
  Branches    13045    13094      +49     
==========================================
+ Hits        45729    45904     +175     
  Misses      12848    12848              
  Partials      120      120              

☔ 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-network-requests-command branch from 783eaed to 9199731 Compare October 9, 2026 07:54
@gwdp

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

Base automatically changed from gwdp/simulator-logs-command to main October 27, 2026 22:02
@gwdp
gwdp force-pushed the gwdp/simulator-network-requests-command branch from f03937b to 836218e Compare October 29, 2026 23:25
@gwdp
gwdp added this pull request to stack #4639 November 20, 2026 21:51
Base automatically changed from gwdp/network-capture-recording-flag to main November 27, 2026 18:44
gwdp and others added 10 commits November 27, 2026 11:44
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Enable JSON output before parsing flags, and rewrite the network capture
errors to say what failed, why, and what to do next.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Validate capture data with zod, write the HAR the way src/utils/download.ts does, and
move 404 messages, Ctrl+C, and the --output spinner to the caller like sibling commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open the --output file with wx so a file created during the download is never
overwritten or removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Track the write stream's open event so a failed download never deletes a file that
another process created at the --output path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gwdp
gwdp force-pushed the gwdp/simulator-network-requests-command branch from 74c9eae to 5b3ae78 Compare November 27, 2026 18:48
@gwdp

This comment has been minimized.

@gwdp

gwdp commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Codex added stopped-session HAR download, numbered request IDs, and the JSON null fix in f4891a16e. Hosted QA verified 1, '#1', and r1 all select the same request. The serializer regression passed locally.

Removed the experimental label from simulator:network-requests in 0614b482a to match #4869. Verified the built help.

— 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 November 27, 2026 19:30
@gwdp
gwdp requested a review from szdziedzic November 27, 2026 19:30
@github-actions

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.

@github-actions

Copy link
Copy Markdown

✅ Thank you for adding a changeset!

@gwdp

This comment has been minimized.

@devin-ai-integration

This comment has been minimized.

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