You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
agent-device test --maestro does not run through the agent-device proxy #1458
bug:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.upstreamBlocked on a dependency's issue, linked in a ## Waiting on upstream comment. Checked weekly.
agent-device test --maestro <flow> does not run through simlock's agent-device proxy from a remote client. open, install, snapshot, screenshot, and replay --maestro work through the same proxy.
Versions
simlock 0.6.0: gateway, plus one worker with capabilities.agent-device.enabled
agent-device 0.21.36 on the client and on the worker
The worker reads the flow from the client's local path and fails with ENOENT. replay --maestro in the same session uploads the flow and its runFlow subflows.
With the flow copied to the same path on the worker, the child session of test fails because the device is busy: the open session holds it.
Without an open session, test fails with "run open first".
Expected
test --maestro uploads the flow files like replay does and runs them on the session's leased device, or leases one itself.
Impact
We run Maestro flows on simulators with test (reporters, retries, JUnit). On leased phones we can only use replay per flow, so phone e2e runs are off for now.
This is a gap, too large for one fix: I recommend a spec session. There is no bug/1458-repro branch. Result 1 reproduces against agent-device 0.21.36 alone, with no simlock in the path, so a simlock test cannot prove it.
I captured the RPC that agent-device test ./flows/first-launch.yaml --maestro --platform ios sends. It ships the flow and its runFlow subflow in flags.replayScriptSources. I sent it to a real 0.21.36 daemon (dist/src/internal/daemon.js, simlock's daemon environment) with the caller's paths moved to a folder this Mac lacks:
entry sent: /Users/someone-else/app/flows/first-launch.yaml exists here: false
files shipped: 2
status 500
"message":"ENOENT: no such file or directory, copyfile '/Users/someone-else/app/flows/first-launch.yaml' -> '<artifacts>/first-launch.yaml/attempt-1/replay.ad'"
Root cause
A gap in simlock, plus one upstream defect. (1) Before each attempt, agent-device's packages/replay-test/src/internal/session-test-attempt.ts:145 copies the source from the caller's path on the daemon's disk (session-test-artifacts.ts:132, fs.copyFileSync). It does not read the bundle the client shipped. This is still on agent-device main. (2) Each attempt runs in its own session, <session>:test:…:attempt-<k> (session-test-discovery.ts:163). Its launchApp opens the device that the outer open session holds. e2e/slow-agent-device.test.ts:816 already notes this. (3) The front leases a device only on lease.allocate (src/agent-device/front/front.ts:139), so a test that names no lease is forwarded with nothing leased. Simlock's refused: no device leased; run open first comes only with a shard flag (request-rules.ts:277). Which line printed the reporter's message needs their exact command.
Simplest fix
None in one PR. (1) belongs in agent-device: copy from replayScriptSources. (2) and (3) need a design: either attempts reuse the outer session's lease (an agent-device change), or the front leases a device for a test that names none.
Alternatives rejected
Copying flows to the worker by hand: fixes (1) only.
Refusing test --maestro in the front: names the gap but closes nothing.
Risk
Filing (1) upstream is the maintainer's call; I filed nothing outside this repo.
Fast track
Defect: no — a gap; result 1 is agent-device's
Fix tried: no — needs a spec
Nothing public added or broken: no — not checked; any fix changes what test does
Filed upstream: callstack/agent-device#4561. It covers the ENOENT (result 1) and notes that attempt sessions can't use the outer session's lease (result 2).
Result 1 (ENOENT) comes from agent-device: before each attempt, its daemon copies the flow from the client's path on its own disk instead of using the replayScriptSources the client sends. Simlock can't fix this.
Result 2 (device busy) also comes from agent-device: each test attempt runs in its own session, which can't use the outer session's lease. #4561 asks for attempts to run on the outer lease.
Result 3 ("run open first") is simlock's call, and it can wait until #4561 lands. The front leases only on lease.allocate. The conservative option is to keep "run open first" and document it. The other option is for the front to lease a device for a test that names none.
Until then, run Maestro flows on leased devices with replay --maestro, one flow at a time.
When #4561 ships in a release: bump @agent-device/proxy to that version, add a slow-lane test for test --maestro through the proxy (replacing the note at e2e/slow-agent-device.test.ts:816), and move this issue back to bug:new for triage of result 3.
The pins on main are now at 0.21.41 (@agent-device/proxy in package.json, agent-device in packages/e2e/package.json), through #1808 (merged a6e3709). That release includes the fix for callstack/agent-device#4561. Moved back to bug:new so result 3 gets triaged and a slow-lane test --maestro check can replace the note in e2e/slow-agent-device.test.ts.
Done: pushed bug/1458-repro, one slow-lane test in e2e/slow-agent-device.test.ts: "an agent that opened a device and installed the Appduct fixture app runs test --maestro on it…". Not run.
Not done: the triage report; any slow-lane run.
Findings: on agent-device 0.21.41 all three results are agent-device's. Simlock's front forwards test unchanged.
Result 1 is fixed: attempts write the shipped sourceText (#4623).
Result 2 remains: each attempt runs in its own session (session-test-attempt.ts:137), and each session is a separate device owner (device-claim-admission.ts:41). #4623 left this alone and #4561 is closed, so no upstream issue tracks it now.
Result 3 is agent-device's client guard, not simlock's front. Nothing reaches simlock:
$ agent-device connect proxy --daemon-base-url http://127.0.0.1:9/v1/agent-device
$ agent-device test ./flows/first-launch.yaml --maestro --platform ios
Error (INVALID_ARGS): No active proxy device lease for this session; run open first.
Blocked on: a slow-lane run of that test: scripts/slow-e2e.sh e2e/slow-agent-device.test.ts -t "test <flow> --maestro". If it fails on a device claim, result 2 needs a new upstream issue.
Result 2 (device busy) is confirmed on 0.21.41 on real devices. The repro test on bug/1458-repro (c3c300a) fails with DEVICE_IN_USE: the test attempt session can't use the device the agent's open session holds.
Result 1 (ENOENT) is fixed upstream in 0.21.41.
Result 3 ("run open first") comes from the agent-device client, not simlock.
Until then, run Maestro flows on leased devices with replay --maestro, one flow at a time.
When #5129 ships in a release: bump the agent-device pins, run the repro test on bug/1458-repro, and move this issue back to bug:new.
bug:blockedAgent stopped on a blocker in its handoff. Maintainer re-adds the label it came from.upstreamBlocked on a dependency's issue, linked in a ## Waiting on upstream comment. Checked weekly.
Activity
V3RON commentedon Nov 15, 2026
Reproduction
This is a gap, too large for one fix: I recommend a spec session. There is no
bug/1458-reprobranch. Result 1 reproduces against agent-device 0.21.36 alone, with no simlock in the path, so a simlock test cannot prove it.I captured the RPC that
agent-device test ./flows/first-launch.yaml --maestro --platform iossends. It ships the flow and itsrunFlowsubflow inflags.replayScriptSources. I sent it to a real 0.21.36 daemon (dist/src/internal/daemon.js, simlock's daemon environment) with the caller's paths moved to a folder this Mac lacks:Root cause
A gap in simlock, plus one upstream defect. (1) Before each attempt, agent-device's
packages/replay-test/src/internal/session-test-attempt.ts:145copies the source from the caller's path on the daemon's disk (session-test-artifacts.ts:132,fs.copyFileSync). It does not read the bundle the client shipped. This is still on agent-devicemain. (2) Each attempt runs in its own session,<session>:test:…:attempt-<k>(session-test-discovery.ts:163). ItslaunchAppopens the device that the outeropensession holds.e2e/slow-agent-device.test.ts:816already notes this. (3) The front leases a device only onlease.allocate(src/agent-device/front/front.ts:139), so atestthat names no lease is forwarded with nothing leased. Simlock'srefused: no device leased; run open firstcomes only with a shard flag (request-rules.ts:277). Which line printed the reporter's message needs their exact command.Simplest fix
None in one PR. (1) belongs in agent-device: copy from
replayScriptSources. (2) and (3) need a design: either attempts reuse the outer session's lease (an agent-device change), or the front leases a device for atestthat names none.Alternatives rejected
test --maestroin the front: names the gap but closes nothing.Risk
Fast track
testdoesWritten by an agent.
V3RON commentedon Nov 15, 2026
Filed upstream: callstack/agent-device#4561. It covers the
ENOENT(result 1) and notes that attempt sessions can't use the outer session's lease (result 2).Written by an agent.
V3RON commentedon Nov 15, 2026
Waiting on upstream
Upstream: callstack/agent-device#4561 (agent-device)
ENOENT) comes from agent-device: before each attempt, its daemon copies the flow from the client's path on its own disk instead of using thereplayScriptSourcesthe client sends. Simlock can't fix this.testattempt runs in its own session, which can't use the outer session's lease. #4561 asks for attempts to run on the outer lease.lease.allocate. The conservative option is to keep "runopenfirst" and document it. The other option is for the front to lease a device for atestthat names none.Until then, run Maestro flows on leased devices with
replay --maestro, one flow at a time.When #4561 ships in a release: bump
@agent-device/proxyto that version, add a slow-lane test fortest --maestrothrough the proxy (replacing the note ate2e/slow-agent-device.test.ts:816), and move this issue back tobug:newfor triage of result 3.Written by an agent.
chore(delivery): an upstream label and a weekly check-upstream routine (
V3RON commentedon Nov 23, 2026
Upstream check
Next: bump agent-device to 0.21.41, then move this issue back to the label it came from.
Written by an agent.
V3RON commentedon Nov 26, 2026
Unblocked
The pins on main are now at 0.21.41 (
@agent-device/proxyinpackage.json,agent-deviceinpackages/e2e/package.json), through #1808 (merged a6e3709). That release includes the fix for callstack/agent-device#4561. Moved back tobug:newso result 3 gets triaged and a slow-lanetest --maestrocheck can replace the note ine2e/slow-agent-device.test.ts.Written by an agent.
V3RON commentedon Nov 26, 2026
Handoff
Done: pushed
bug/1458-repro, one slow-lane test ine2e/slow-agent-device.test.ts: "an agent that opened a device and installed the Appduct fixture app runs test --maestro on it…". Not run.Not done: the triage report; any slow-lane run.
Findings: on agent-device 0.21.41 all three results are agent-device's. Simlock's front forwards
testunchanged.sourceText(#4623).session-test-attempt.ts:137), and each session is a separate device owner (device-claim-admission.ts:41). #4623 left this alone and #4561 is closed, so no upstream issue tracks it now.Blocked on: a slow-lane run of that test:
scripts/slow-e2e.sh e2e/slow-agent-device.test.ts -t "test <flow> --maestro". If it fails on a device claim, result 2 needs a new upstream issue.Written by an agent.
V3RON commentedon Nov 26, 2026
Waiting on upstream
Upstream: callstack/agent-device#5129 (agent-device)
bug/1458-repro(c3c300a) fails withDEVICE_IN_USE: thetestattempt session can't use the device the agent'sopensession holds.ENOENT) is fixed upstream in 0.21.41.Until then, run Maestro flows on leased devices with
replay --maestro, one flow at a time.When #5129 ships in a release: bump the agent-device pins, run the repro test on
bug/1458-repro, and move this issue back tobug:new.Written by an agent.
V3RON commentedon Nov 26, 2026
Delivery run
Merged: none
Parked: #1458 — result 2 (DEVICE_IN_USE) is agent-device's; confirmed on the slow lane, filed callstack/agent-device#5129
Waiting: #1458 — on callstack/agent-device#5129
Written by an agent.
chore(agents): a slow-lane failure is sorted before any fix run, and …