Repository navigation
Description
Summary
agent-device test <flow> --maestro fails with ENOENT when the daemon runs on another machine (a remote daemon or a connect proxy connection). Before each attempt, the daemon copies the flow from the client's local path on its own disk. replay --maestro on the same connection works, because it uses the flow sources the client sends.
Versions
- agent-device 0.21.36 on the client and the daemon. The code path below is unchanged on
main(7848a1a). - Seen through simlock's agent-device proxy, with the client and the worker on two different Macs (agent-device test --maestro does not run through the agent-device proxy callstackincubator/simlock#1458). It also reproduces against a plain local 0.21.36 daemon, with no proxy, as below.
Steps
- Capture the RPC that
agent-device test ./flows/first-launch.yaml --maestro --platform iossends. It already carries the flow and itsrunFlowsubflow inflags.replayScriptSources. - Send that request to a 0.21.36 daemon after moving the caller's paths to a folder the daemon host does not have (as if the client were another machine).
Result
status 500
ENOENT: no such file or directory, copyfile '/Users/someone-else/app/flows/first-launch.yaml' -> '<artifacts>/first-launch.yaml/attempt-1/replay.ad'
The request fails before it reaches a device.
Cause
packages/replay-test/src/internal/session-test-attempt.ts:145 calls prepareReplayTestAttemptArtifacts(entry.path, …). That leads to copyReplaySourceFile in packages/replay-test/src/internal/session-test-artifacts.ts:130, which runs fs.copyFileSync(filePath, …) on the caller's path. It never reads the shipped replayScriptSources.
Expected
test --maestro on a remote connection reads the flow and subflows from replayScriptSources, the way replay --maestro does, both for the attempt artifacts and for the run.
Related: attempts can't use the outer session's leased device
Once the flow exists on the daemon host (copied there by hand), the next blocker shows up. Each attempt runs in its own session, <session>:test:…:attempt-<k> (session-test-discovery.ts:163). On a leased connection, that session's launchApp tries to open the device the outer open session already holds, and fails because the device is busy. Without an open first, nothing is leased. So test can't run on a leased remote device at the moment. A fix would need the attempt sessions to run on the outer session's lease. If you want this tracked separately, say so and I'll split it out.
Written by an agent.
Activity
chore(delivery): an upstream label and a weekly check-upstream routine (
thymikee commentedon Nov 16, 2026
Triage: bug; the source-path failure is confirmed on current main. Attempt preparation copies entry.path directly before replay runs, so the supplied source bundle cannot prevent this ENOENT. Source materialization and leased-attempt ownership are separate problems: fixing the first does not establish that an attempt may reuse the outer lease. The active replay/plugin extraction also changes these owners, so its integration needs to account for this report before a separate implementation starts.
mvanhorn commentedon Nov 17, 2026
Each attempt called prepareReplayTestAttemptArtifacts with only entry.path, and copyReplaySourceFile always used copyFileSync on that path.
inspectReplayTestSource now returns the script it read as sourceText, and discoverReplayTestEntries copies that field onto a run entry when the source has it. runSingleReplayTestAttempt passes entry.sourceText into prepareReplayTestAttemptArtifacts.
#4623
refactor(replay-test): require shipped source text on replay test sou…
test(session-test-source-discovery-inspection): write remote test att…
thymikee commentedon Nov 21, 2026
Fixed by #4623, first released in v0.21.40: a remote
test --maestroattempt now writes its artifacts from the shipped script source instead of copying the flow from the client's path. Reopen with the version and command output if it still fails on 0.21.40 or later.