Skip to content

Commit ab1fc6d

Browse files
committed
fix(record): say a timed-out record stop may still be exporting
A record stop that times out while still queued for the device lock is dropped at lock entry, so no export ran. The timeout hint now says the daemon may still be exporting and keeps the retry instruction. The docs no longer call the in-progress export typical only for a remote daemon, since a local daemon now survives the timeout too.
1 parent f2f48a8 commit ab1fc6d

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎src/daemon-client/__tests__/daemon-client-timeout-route.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ test('a local record stop timeout keeps the exporting daemon alive and names the
333333
assert.equal(error.details?.reason, 'daemon_transport_timeout');
334334
assert.match(
335335
error.details?.hint as string,
336-
/^The daemon is still exporting the recording\. Run agent-device record stop --session e2e-ios-0 again/,
336+
/^The daemon may still be exporting the recording\. Run agent-device record stop --session e2e-ios-0 again/,
337337
);
338338
return true;
339339
},

‎src/daemon-client/__tests__/daemon-client-timeout.test.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test('a timed-out record stop on a surviving daemon names the retry that returns
107107
action: 'stop',
108108
session: 'recording',
109109
}),
110-
'The remote daemon is still exporting the recording. Run agent-device record stop --session recording again to wait for that export and receive the completed recording.',
110+
'The remote daemon may still be exporting the recording. Run agent-device record stop --session recording again to wait for that export and receive the completed recording.',
111111
);
112112
assert.equal(
113113
resolveRequestTimeoutHint({
@@ -117,9 +117,9 @@ test('a timed-out record stop on a surviving daemon names the retry that returns
117117
appleCleanupEvidence: false,
118118
action: 'stop',
119119
}),
120-
'The remote daemon is still exporting the recording. Run agent-device record stop again to wait for that export and receive the completed recording.',
120+
'The remote daemon may still be exporting the recording. Run agent-device record stop again to wait for that export and receive the completed recording.',
121121
);
122-
// A local daemon preserved across the timeout is still exporting too.
122+
// A local daemon preserved across the timeout may still be exporting too.
123123
assert.equal(
124124
resolveRequestTimeoutHint({
125125
remote: false,
@@ -129,7 +129,7 @@ test('a timed-out record stop on a surviving daemon names the retry that returns
129129
action: 'stop',
130130
session: 'recording',
131131
}),
132-
'The daemon is still exporting the recording. Run agent-device record stop --session recording again to wait for that export and receive the completed recording.',
132+
'The daemon may still be exporting the recording. Run agent-device record stop --session recording again to wait for that export and receive the completed recording.',
133133
);
134134
// A reset daemon is no longer exporting, so no keep-exporting promise is made.
135135
assert.equal(

‎src/daemon-client/daemon-client-timeout.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,11 @@ export function resolveRequestTimeoutHint(params: {
136136
session?: string;
137137
}): string {
138138
const { remote, resetDaemon, command, appleCleanupEvidence, session, action } = params;
139-
// A daemon that survives this client window is still exporting a `record stop` that ran out of
140-
// time, and its finished file stays retrievable by asking again. A reset daemon makes no such
141-
// promise.
139+
// A daemon that survives this client window may still be exporting a `record stop` that ran out
140+
// of time (a stop still queued for the device lock is dropped before any export starts), and a
141+
// finished file stays retrievable by asking again. A reset daemon makes no such promise.
142142
if (!resetDaemon && command === PUBLIC_COMMANDS.record && action === 'stop') {
143-
return `The ${remote ? 'remote ' : ''}daemon is still exporting the recording. Run agent-device record stop${
143+
return `The ${remote ? 'remote ' : ''}daemon may still be exporting the recording. Run agent-device record stop${
144144
session ? ` --session ${session}` : ''
145145
} again to wait for that export and receive the completed recording.`;
146146
}

‎website/docs/docs/commands.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ agent-device record stop # Stop active recording
10921092
- Android uses `adb shell screenrecord`, which has a 180s platform limit. `record start` publishes a durable device manifest. Longer recordings are split into MP4 chunks while the daemon stays alive; after daemon restart, `record stop` recovers only manifest-owned chunks and warns when gesture overlay telemetry was lost.
10931093
- Android `screenrecord` encodes a frame only when the screen changes, so a clip ends at the last frame the recorder encoded instead of at `record stop`: a window that ends on an unchanged screen yields a shorter video, while every on-screen change inside the window stays at its real offset in it. `record stop` reports `durationMs` as host wall clock from `record start` until the export finished, and when the video can be measured it also reports `capturedDurationMs` and warns with how much of the window that video covers.
10941094
- Limrun iOS and Android direct sessions record the whole simulator or emulator screen through the provider's server-side recorder, so every `--scope` captures the same frame and `--fps` and `--hide-touches` are refused with `INVALID_ARGS` before any device work. `record stop` asks the instance to stop once and then downloads the served MP4 to the output path; that download is bounded to end inside the request window, so a slow or dropped transfer ends typed, leaves no file behind, and is retried by the next `record stop` from the same URL while the instance lives. Nothing survives a daemon restart: the recording is `unreattachable` and the instance disposes the file when the lease is released.
1095-
- `record stop` is safe to repeat. When its request window ends while the daemon is still exporting — typical for a long touch-overlay burn-in on a remote daemon — the export keeps running there, and a second `record stop` in the same session returns that completed recording, including the caller-side output path, without starting another recording. A finished recording whose video file is already gone reports `no active recording`.
1095+
- `record stop` is safe to repeat. When its request window ends while the daemon is still exporting — typical for a long touch-overlay burn-in, on a local or remote daemon — the export keeps running there, and a second `record stop` in the same session returns that completed recording, including the caller-side output path, without starting another recording. A finished recording whose video file is already gone reports `no active recording`.
10961096
- A recording answers two independent questions, and `record stop` reports both: whether a playable export exists, and whether the recorder stopped. `recorder` is `confirmed` when the recorder exited or acknowledged a stop meant for this recording, and `lost` when the session holding it died — an Apple recording invalidated by a runner restart. `nativePathDisposition` says what became of the artifact path the recorder itself writes to: `retirable` while that file still sits there owed a removal, and `retired` once its removal was verified. Both are optional disclosures — the export is served either way, a replay of a recording stopped before they existed omits them, and so does a backend whose recorder writes the served file itself. The vocabulary is deliberately wider than today's answers: `recorder: unconfirmed` (a probe that could not be read, or no exit inside the stop budget), the identity-mismatch reasons under `lost`, and `nativePathDisposition: pending` are declared by [ADR 0024](https://github.com/callstack/agent-device/blob/main/docs/adr/0024-screen-recording-provable-signal.md) for the steps that gain those probes, and no stop reports them yet.
10971097
10981098
- `record contact-sheet <video.mp4> [--out <sheet.png>]` turns a recording you already exported into one PNG: the frames where the screen visibly changed, laid out in a grid and each labeled with its elapsed time (`HH:MM:SS.mmm`) on the clip timeline. It is how an agent reads a recording it cannot play. It reads the file you pass — no session, no device, no daemon — so it can rebuild an old take and the sheet can only describe screens that export contains. Any backend that exports MP4 works (Apple, Android, HarmonyOS, Limrun); a WebM recording from the web backend is refused with `details.reason: contact_sheet_container_unsupported`. The default output is `<recording>.contact-sheet.png`, and `--out` is refused when it points back at the recording itself, because a sheet is derived from a take and never replaces it. `--json` reports each cell's time and changed-pixel share alongside `sampledFrameCount`, `decodedFrameCount`, and `skippedSampleCount`.

0 commit comments

Comments
 (0)