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
slow-agent-device: daemon-kill test still expects the next command to fail, but #1466 restores the lease #1577
The slow-lane test e2e/slow-agent-device.test.ts > agent-device through simlock (Android) > "when the agent-device daemon is killed, a new one with a new pid runs; the agent's next command fails with lease ended by simlock, and its simlock lease is released" fails on main, at e2e/slow-agent-device.test.ts:507: expect(next.code).not.toBe(0) gets 0.
Why:#1466 (fadc7ae) changed the behaviour. When agent-device's heartbeat gets LEASE_NOT_FOUND for a lease Simlock still holds, it now allocates the lease again on the same device (src/agent-device/front/heartbeat.ts, src/agent-device/AGENTS.md). So after an agent-device daemon kill, the next snapshot succeeds (success: true) and the lease stays held. The test still claims the old behaviour. Its iOS twin makes the same claim, but it is skipped on an Android-only lane.
Reproduced: on a worktree of main 6dcbd34, with only the session-naming helper line from #1573 applied (the unfixed helper can't run the test at all; agent-device 0.21.36 refuses connect proxy without a session). Log: /var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T//simlock-slow-e2e-20261115-180104.log, "expected +0 not to be +0". It failed in three runs, so it is not a flake.
Decision needed: rewrite the test's claim to match #1466 (the next command succeeds and the lease stays held), or change #1466.
The failing test is on main, unchanged since #1366: e2e/slow-agent-device.test.ts:489, "when the agent-device daemon is killed, … the agent's next command fails with lease ended by simlock, and its simlock lease is released". Slow lane only, so not rerun here; the reporter's three runs fail at :507. bug/1577-repro is origin/main, which holds it.
scripts/slow-e2e.sh e2e/slow-agent-device.test.ts # needs #1573's AGENT_DEVICE_SESSION helper line
AssertionError: expected +0 not to be +0 # expect(next.code).not.toBe(0), :507
The behaviour the test should claim passes at unit level:
pnpm exec vitest run --project unit src/agent-device/edge-restart.test.ts -t "next heartbeat succeeds"
Tests 6 passed | 16 skipped (22)
Root cause
Defect, in the test. e2e/slow-agent-device.test.ts:506-513 still asserts ADR 0023 §3, which ADR 0071 §1 superseded. #1466 (src/agent-device/front/heartbeat.ts, restoreLease) re-allocates the lease, as ADR 0071, src/agent-device/AGENTS.md and agent-device.mdx:209 say. #1464 named only unit tests, so this test was never updated.
Simplest fix
Rewrite the test (about 15 lines). Before the kill: install Appduct <app> and record listLeases. After it: ok(open <bundleId>) and ok(snapshot). The test then asserts the lease's id and deviceId are unchanged and one lease is listed. New title: "…a new one with a new pid runs; the agent opens the installed Appduct fixture app again and takes a snapshot, and its simlock lease stays, on the same device". The open <app> covers iOS, where mdx:209 says a command before a new open answers SESSION_NOT_FOUND.
Option A: keep #1466 (ADR 0071 §1). Rewrite the daemon-kill test so it claims the current behaviour: after the agent-device daemon is killed, the agent opens the app again, its next command succeeds, and the lease keeps its id and device. #1466 stays as it is.
Done:#1579 rewrites the daemon-kill test at e2e/slow-agent-device.test.ts:489 for Option A (ADR 0071 §1): after the kill the agent opens the app again, its snapshot succeeds, and the lease keeps its id and device. Review round 1: 0 findings in all three lenses. The PR is ready and labelled needs-hardware.
Not done: the slow-lane run, so the Done when line is unticked. The gate has not run.
Findings: the lane stopped in setup, before the test's assertions: agent-device replied REMOTE_SESSION_REQUIRED from connect proxy (e2e/helpers/agent-device.ts:173). This is the session-naming helper that #1573 fixes, not the daemon-kill behaviour.
Blocked on:#1573 merging. Then run verify-hardware on #1579, and the gate.
Merged: none
Parked: #1577 — #1579 needs-hardware: the slow lane cannot run the test until #1573's session helper merges
Decided: #1577 — rewrite the test or change #1466 → rewrite the test (maintainer's choice)
Reproduced on base 6dcbd34 (with only the agent-device session-name helper line applied), run alone with -t: the daemon-kill test fails with expected +0 not to be +0. So it is not caused by the #1569 stack (PR #1573); same #1466 staleness this issue describes.
Activity
V3RON commentedon Nov 15, 2026
Reproduction
The failing test is on
main, unchanged since #1366:e2e/slow-agent-device.test.ts:489, "when the agent-device daemon is killed, … the agent's next command fails with lease ended by simlock, and its simlock lease is released". Slow lane only, so not rerun here; the reporter's three runs fail at:507.bug/1577-reproisorigin/main, which holds it.The behaviour the test should claim passes at unit level:
Root cause
Defect, in the test.
e2e/slow-agent-device.test.ts:506-513still asserts ADR 0023 §3, which ADR 0071 §1 superseded. #1466 (src/agent-device/front/heartbeat.ts,restoreLease) re-allocates the lease, as ADR 0071,src/agent-device/AGENTS.mdandagent-device.mdx:209say. #1464 named only unit tests, so this test was never updated.Simplest fix
Rewrite the test (about 15 lines). Before the kill:
install Appduct <app>and recordlistLeases. After it:ok(open <bundleId>)andok(snapshot). The test then asserts the lease'sidanddeviceIdare unchanged and one lease is listed. New title: "…a new one with a new pid runs; the agent opens the installed Appduct fixture app again and takes a snapshot, and its simlock lease stays, on the same device". Theopen <app>covers iOS, wheremdx:209says a command before a newopenanswersSESSION_NOT_FOUND.Alternatives rejected
not.toBe(0)took(next): fails when the case runs on iOS.Risk
verify-hardware) on top of feat(ios): sources live in a folder as long as the device set #1573's helper fix.open <bundleId>after the restart on Android is inferred frommdx:209, not observed.:517(simlock kill) makes the same stale claim: slow-agent-device: the simlock-kill test claims the lease ends, but ADR 0071 §4 says a standalone worker restart keeps it #1578.Fast track
Side findings
Written by an agent.
V3RON commentedon Nov 15, 2026
Maintainer decision
Option A: keep #1466 (ADR 0071 §1). Rewrite the daemon-kill test so it claims the current behaviour: after the agent-device daemon is killed, the agent opens the app again, its next command succeeds, and the lease keeps its id and device. #1466 stays as it is.
Recorded on the maintainer's instruction.
Written by an agent.
V3RON commentedon Nov 15, 2026
Handoff
Done: #1579 rewrites the daemon-kill test at
e2e/slow-agent-device.test.ts:489for Option A (ADR 0071 §1): after the kill the agent opens the app again, its snapshot succeeds, and the lease keeps its id and device. Review round 1: 0 findings in all three lenses. The PR is ready and labelledneeds-hardware.Not done: the slow-lane run, so the Done when line is unticked. The gate has not run.
Findings: the lane stopped in setup, before the test's assertions: agent-device replied
REMOTE_SESSION_REQUIREDfromconnect proxy(e2e/helpers/agent-device.ts:173). This is the session-naming helper that #1573 fixes, not the daemon-kill behaviour.Blocked on: #1573 merging. Then run
verify-hardwareon #1579, and the gate.Written by an agent.
V3RON commentedon Nov 15, 2026
Delivery run
Merged: none
Parked: #1577 — #1579 needs-hardware: the slow lane cannot run the test until #1573's session helper merges
Decided: #1577 — rewrite the test or change #1466 → rewrite the test (maintainer's choice)
Written by an agent.
V3RON commentedon Nov 15, 2026
Reproduced on base 6dcbd34 (with only the agent-device session-name helper line applied), run alone with
-t: the daemon-kill test fails withexpected +0 not to be +0. So it is not caused by the #1569 stack (PR #1573); same #1466 staleness this issue describes.Written by an agent.