Skip to content

fix: recover Android recordings after daemon restart#1129

Merged
thymikee merged 3 commits into
mainfrom
fix/android-recording-recovery-1117
Jul 6, 2026
Merged

fix: recover Android recordings after daemon restart#1129
thymikee merged 3 commits into
mainfrom
fix/android-recording-recovery-1117

Conversation

@thymikee

@thymikee thymikee commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #1117 by recovering Android screenrecord when daemon recording state is lost before record stop.

Adds device-side recovery metadata plus a bounded process-scan fallback so a fresh daemon can stop, pull, and clean the orphaned recording instead of returning no active recording.

Validation

  • pnpm format
  • pnpm typecheck
  • pnpm build
  • pnpm vitest run --project unit src/daemon/handlers/tests/record-trace.test.ts
  • pnpm vitest run --project provider-integration test/integration/provider-scenarios/android-recording.test.ts
  • pnpm test:integration:provider
  • pnpm test:smoke
  • Emulator verification on Pixel 9 Pro XL API 37 / emulator-5554: start recording, scroll Settings, wipe daemon state mid-recording, then record stop from a fresh daemon recovered and produced a non-empty MP4.

Attempted pnpm check:unit and pnpm test:coverage; both hit unrelated host-load/platform flakes, and the failing files/groups passed when rerun in isolation.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.5 MB 1.5 MB +6.5 kB
JS gzip 492.6 kB 494.1 kB +1.4 kB
npm tarball 588.6 kB 590.0 kB +1.5 kB
npm unpacked 2.1 MB 2.1 MB +6.5 kB

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 26.8 ms 27.5 ms +0.7 ms
CLI --help 50.7 ms 50.6 ms -0.1 ms

Top changed chunks:

Chunk Raw diff Gzip diff
dist/src/record-trace-recording.js +6.5 kB +1.4 kB

@thymikee

thymikee commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Ready for human review.

Review pass on #1129:

  • GitHub CI is clean: 21/21 checks passing.
  • The original Fallow failure was fixed by bed08021c.
  • The recovery path is intentionally conservative: it only runs when daemon recording state is missing and no session still has active recording state, validates metadata against a live Android screenrecord process, uses bounded ADB probes, and refuses ambiguous recovery when multiple agent-device recordings are active.
  • The PR includes provider integration coverage plus live emulator evidence: Pixel 9 Pro XL API 37 / emulator-5554, recording recovered after daemon state was wiped mid-recording and produced a non-empty MP4.

Residual risk: this is the narrow recovery fix for #1117. Durable chunk/session ownership hardening is intentionally stacked in #1131 / #1130, so it should follow this PR rather than block it.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jul 6, 2026
@thymikee thymikee force-pushed the fix/android-recording-recovery-1117 branch from bed0802 to bc2bd44 Compare July 6, 2026 11:58
@thymikee thymikee merged commit be4bd09 into main Jul 6, 2026
21 checks passed
@thymikee thymikee deleted the fix/android-recording-recovery-1117 branch July 6, 2026 13:28
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-07-06 13:28 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

record stop fails with INVALID_ARGS "no active recording" while its on-device screenrecord process is still running

1 participant