fix(record): record a remote client's default recording on the daemon host

Merged
TH
11h ago
+65-14

Summary

Found while driving an EAS cloud simulator session. On a remote daemon (AGENT_DEVICE_DAEMON_BASE_URL), record start with no path and no --platform failed: the daemon resolved ./recording-<ts>.mp4 against the client's cwd on its own host (EACCES/ENOENT: mkdir '<client cwd>').

The client can't pick the extension here, because it depends on the session platform. It now sends its local destination without an extension (clientArtifactPaths.outPath = <cwd>/recording-<ts>). The daemon's record handler (prepareRecordingStart) adds the platform extension, records to a daemon-host temp path, and record stop downloads to the client path. resolveRecordingOutputPaths is unchanged and stays transport-free. Explicit paths were already redirected by the client. The docs now say where the default downloads. 5 files.

Validation

Head e166701772, base 2a2f3f2906. pnpm check:affected --run passed (308 files, 1970 tests, wire-compat unchanged). scripts/__tests__/eager-closure-budgets.test.ts passed (914). The new tests fail without the production change.

Live run: agent-device proxy on macOS, client in a colima Linux container, cwd /client.

Android, Pixel_9_Pro_XL_API_37:

base 2a2f3f2906head 9c1e5585e9
record startError (UNKNOWN): ENOENT: no such file or directory, mkdir '/client'/client/recording-1792092638666.mp4; stop downloads it (840 KB)
record start out/rel.mp4 and /client/out/abs.mp4okok

iOS simulator, head e166701772: record start --json returns "outPath": "/client/recording-1792130997510.mp4". record stop downloads it: ls shows 1934217 bytes, an ftypmp42 header, and the telemetry file next to it.

Same-machine client: default and explicit recordings are still written to cwd.

Risks:

  • A new client with an older remote daemon and no --platform still fails, as before.
  • Remote record start clip (no extension) on web without --platform still fails. This was already the case before this change.