Skip to content

[build-tools] Fix Argent tool server state discovery#3997

Merged
sjchmiela merged 2 commits into
mainfrom
stanley/fix-argent
Jul 10, 2026
Merged

[build-tools] Fix Argent tool server state discovery#3997
sjchmiela merged 2 commits into
mainfrom
stanley/fix-argent

Conversation

@sjchmiela

Copy link
Copy Markdown
Contributor

Why

Argent now writes per-install tool-server state files such as ~/.argent/tool-server-<hash>.json. The remote session step only watched the legacy tool-server.json, so it could time out even when the newly launched tool server was running.

How

  • expose the PID of detached processes
  • add a process ancestry helper that works on macOS and Linux
  • run Argent in the foreground beneath the detached bunx process and pass --force
  • scan legacy and hashed Argent state files, selecting only the state whose PID descends from the launched bunx process
  • validate the state schema includes the tool-server PID
  • cover legacy, hashed, matching, and unrelated state files

Test Plan

  • yarn workspace @expo/build-tools jest-unit packages/build-tools/src/steps/functions/__tests__/startArgentRemoteSession.test.ts --runInBand
  • yarn workspace @expo/build-tools build
  • yarn workspace @expo/worker build
  • yarn workspace eas-cli build
  • yarn workspace @expo/build-tools typecheck
  • yarn lint
  • yarn fmt:check

@sjchmiela sjchmiela added the no changelog PR that doesn't require a changelog entry label Jul 10, 2026
@sjchmiela sjchmiela marked this pull request as ready for review July 10, 2026 13:29
@sjchmiela sjchmiela requested a review from szdziedzic July 10, 2026 13:29
@github-actions

Copy link
Copy Markdown

⏩ The changelog entry check has been skipped since the "no changelog" label is present.

@github-actions

Copy link
Copy Markdown

Subscribed to pull request

File Patterns Mentions
**/* @douglowder

Generated by CodeMention

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

@codecov

codecov Bot commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.91304% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.67%. Comparing base (6d02728) to head (94396e8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ls/src/steps/functions/startArgentRemoteSession.ts 70.97% 9 Missing ⚠️
packages/build-tools/src/utils/processes.ts 85.72% 2 Missing ⚠️
...ld-tools/src/steps/utils/remoteDeviceRunSession.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3997      +/-   ##
==========================================
+ Coverage   59.67%   59.67%   +0.01%     
==========================================
  Files         940      941       +1     
  Lines       41260    41318      +58     
  Branches     8666     8675       +9     
==========================================
+ Hits        24617    24654      +37     
- Misses      16549    16570      +21     
  Partials       94       94              

☔ 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.

@sjchmiela sjchmiela merged commit 2e2e8ff into main Jul 10, 2026
11 of 12 checks passed
@sjchmiela sjchmiela deleted the stanley/fix-argent branch July 10, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changelog PR that doesn't require a changelog entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants