fix: make record app-scoped by default#1163
Conversation
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
Review: does this fix #1162 correctly?TL;DR — yes for the reported repro, and it's well-tested and green, but it's a scoped fix that closes the exact reproduction rather than the general "valid MP4 of the wrong surface" class the issue describes. The gate is built on session state ( What it fixes, and why it worksThe repro hinges on a fact that's easy to miss: The two new guards both land on this:
Tests cover both, plus the still-supported record-only path and the metadata. CI is green. Residual gaps (the part I'd flag)
Closing (1)–(2) really needs one Minor
Net: good, safe, well-tested fix for the filed repro. I'd merge it, but I'd either re-scope #1162 to "explicit-session fallback" (and open a follow-up for real foreground verification) or note in the PR that the foreground-proof guarantee and the remaining JSON fields are deferred. |
5dfc715 to
ecfe909
Compare
|
Review pass on ecfe909: checked the record start/stop route against issue #1162. Explicit missing sessions now fail before record-only capture, existing iOS simulator sessions require active app context, Agent Device Runner is rejected as the active app, and record-only simulator capture remains available without an existing explicit session. Metadata is added to start/stop responses, tests cover the reported path, and the PR includes live iPhone 17 simulator evidence. Checks are 21/21 green. No actionable blockers found. |
|
|
Reconciled the earlier scope concern in 6288138.
I also verified the revised behavior live on an iPhone 17 simulator:
The remaining caveat is intentional for this PR: app scope is enforced from tracked session state, not a new iOS foreground-bundle probe. |
6288138 to
5364abc
Compare
Summary
Makes
record startapp-scoped by default: it now requires an active app session fromopen <app>instead of silently creating a record-only whole-screen capture when the session is missing.Adds explicit
--scope app|device|system;device/systemare the opt-in whole-screen intent values for recordings that intentionally span the full screen, multiple apps, Settings, Home, or app transitions. iOS simulator record-only capture now requires one of those whole-screen scopes.Persists and returns
recordingScopealongside the existing backend, record-only state, active app, and duration metadata, and updates CLI help/docs plus provider scenarios for the new default.Scope note: this resolves #1162 by making app proof videos the default and whole-screen capture explicit. It does not add a new iOS foreground-bundle probe; app scope is enforced from session state today.
Validation
pnpm check:quick./node_modules/.bin/vitest run --project unit-core src/commands/recording/index.test.ts src/cli/parser/__tests__/args-parse-interaction.test.ts src/cli/parser/__tests__/cli-help-command-usage.test.ts./node_modules/.bin/vitest run --project unit-core src/commands/recording/index.test.ts src/cli/parser/__tests__/args-parse-interaction.test.ts src/daemon/handlers/__tests__/record-trace.test.ts./node_modules/.bin/vitest run --project unit-core src/commands/__tests__/command-flags.test.ts src/cli/parser/__tests__/cli-help-command-usage.test.ts./node_modules/.bin/vitest run --project provider-integration./node_modules/.bin/vitest run --project unit-core --project android-adb./node_modules/.bin/vitest run --coveragenode --test test/integration/smoke-*.test.ts./node_modules/.bin/tsdownoxfmt --writeover the repo becausepnpm formatwas blocked by pnpm version verification in this environment.--sessionwithINVALID_ARGSand creates no MP4.--scope devicerecord-only capture succeeds and produces/private/tmp/agent-device-record-device-scope.mp4(52K), then cleans up the session.open settingsfollowed by defaultrecord startsucceeds withrecordingScope: "app"andactiveSessionApp.bundleId: "com.apple.Preferences", produces/private/tmp/agent-device-record-app-scope.mp4(52K), then cleans up the session.