What happened
agent-device 0.21.1, Android emulators managed by an external tool that stops, parks and later re-adopts them under a new serial. On the first record start of a new session against a re-adopted emulator:
Android screenrecord native recovery evidence already exists
(internal error, "retry with --debug"). record stop then says "no active recording"; closing and reopening the session does not clear it. Cause: a stale /sdcard/agent-device-recording-active.json left by an earlier session on the same AVD, whose deviceId (the old serial) no longer matches, so the recovery check throws instead of retiring the manifest. Deleting the file by hand (adb shell rm /sdcard/agent-device-recording-active.json) fixes it.
Seen on three separate runs in two days, whenever an emulator changed serial between sessions. The failure is also easy to miss: with default output the last line is Session state: ... and the error is only in the request ndjson, so the run continues unrecorded.
Proposal
When the manifest's deviceId does not match the current serial, or its session is no longer registered, retire the manifest and start the recording; and print the refusal on stdout so a caller sees it.
What happened
agent-device 0.21.1, Android emulators managed by an external tool that stops, parks and later re-adopts them under a new serial. On the first
record startof a new session against a re-adopted emulator:(internal error, "retry with --debug").
record stopthen says "no active recording"; closing and reopening the session does not clear it. Cause: a stale/sdcard/agent-device-recording-active.jsonleft by an earlier session on the same AVD, whosedeviceId(the old serial) no longer matches, so the recovery check throws instead of retiring the manifest. Deleting the file by hand (adb shell rm /sdcard/agent-device-recording-active.json) fixes it.Seen on three separate runs in two days, whenever an emulator changed serial between sessions. The failure is also easy to miss: with default output the last line is
Session state: ...and the error is only in the request ndjson, so the run continues unrecorded.Proposal
When the manifest's
deviceIddoes not match the current serial, or its session is no longer registered, retire the manifest and start the recording; and print the refusal on stdout so a caller sees it.