Skip to content

feat: add recording quality flag#409

Merged
thymikee merged 4 commits intomainfrom
codex/record-quality-flag
Apr 15, 2026
Merged

feat: add recording quality flag#409
thymikee merged 4 commits intomainfrom
codex/record-quality-flag

Conversation

@thymikee
Copy link
Copy Markdown
Contributor

@thymikee thymikee commented Apr 13, 2026

Summary

Add explicit record start --quality <5-10> support without changing recording defaults. Omitting quality preserves the existing platform-native recording path, and explicit quality: 10 is treated as native/no resize.

How It Works

  • CLI/schema validation accepts integer values from 5 through 10.
  • Client, daemon, session logging, and replay script plumbing preserve the flag so recorded flows can be replayed with the same quality choice.
  • Android: for quality 5-9, the daemon reads adb shell wm size, prefers override dimensions when present, computes even scaled dimensions, and starts adb shell screenrecord --size <width>x<height>. FPS is unchanged.
  • iOS physical device and macOS runner: the daemon forwards quality to the XCTest runner. The runner scales captured frame dimensions before encoding, while keeping FPS behavior unchanged.
  • iOS simulator: simctl recordVideo does not expose a resolution setting, so recording starts the same way as before. On stop, quality 5-9 runs the bundled recording-resize.swift helper to resize the MP4 before the existing telemetry/overlay finalization continues. Quality 10 skips this pass.
  • Resize failures on simulator recordings are non-fatal: the original video is kept and record stop returns an overlayWarning, matching the existing best-effort finalization style.

Environment / Tooling

No new package or system-tool installation is required for this feature.

  • No new npm dependencies, Homebrew packages, or separate agent-sandbox tools are added.
  • Android uses the existing adb requirement already needed for Android recording.
  • iOS simulator/device and macOS recording use the existing Xcode tooling requirement (xcrun, simctl, and Swift via xcrun swift). The resize helper is checked into the repo and invoked from the existing recording post-processing path.

In short: users only need the same platform tools they already needed for recording on the target platform.

Validation

  • pnpm format
  • pnpm exec vitest run src/utils/__tests__/args.test.ts src/daemon/handlers/__tests__/record-trace.test.ts src/daemon/handlers/__tests__/session-replay-script.test.ts src/daemon/__tests__/session-store.test.ts src/platforms/ios/__tests__/runner-client.test.ts src/platforms/ios/__tests__/recording-scripts.test.ts
  • pnpm check:quick
  • pnpm build:xcuitest
  • pnpm test:smoke
  • git diff --check

Known validation note: pnpm check:unit still exits -1 inside vitest run after fixture stdout and without assertion failure details; the targeted affected Vitest suites and smoke tests pass.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://callstackincubator.github.io/agent-device/pr-preview/pr-409/

Built to branch gh-pages at 2026-04-15 11:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9debf39576

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +72 to +74
let scaledTransform = sourceVideoTrack.preferredTransform.concatenating(
CGAffineTransform(scaleX: scale, y: scale)
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Scale translation when resizing transformed recordings

When a source track has a non-identity preferredTransform (common for landscape/rotated iOS simulator videos), composing sourceVideoTrack.preferredTransform.concatenating(CGAffineTransform(scaleX:y:)) scales the picture but leaves the transform’s translation terms in the original coordinate space, so frames are shifted outside the smaller renderSize and the resized output is cropped/partially blank. This only appears for transformed inputs, but it breaks the new --quality path in those recordings; apply scaling in the correct transform order (or scale tx/ty explicitly) so translation matches the resized canvas.

Useful? React with 👍 / 👎.

@thymikee thymikee merged commit 364844e into main Apr 15, 2026
15 checks passed
@thymikee thymikee deleted the codex/record-quality-flag branch April 15, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant