← Notes
June 19, 2026·2 min readopen-sourcecontributingai-agents

Making Recording Export Quality Configurable in agent-device

Making Recording Export Quality Configurable in agent-device

Added a new --export-quality CLI flag to let users choose between medium and high quality video exports, replacing the hardcoded highest quality preset. This is a draft PR that wires together an existing but unused scaffold end-to-end through the CLI, client, daemon, and Swift export layer.

What

The recording export step in agent-device was hardcoded to use AVAssetExportPresetHighestQuality for all exports. This change introduces a new --export-quality flag with two options: medium (the new default for backward compatibility) and high. The flag is validated at the daemon level and rejected with INVALID_ARGS if an unknown value is passed. This is kept separate from the existing --quality flag which controls capture resolution.

Why it matters

Users may want faster exports with smaller file sizes instead of always waiting for the highest quality re-encode. By making this configurable, teams can balance their workflow needs. The maintainer confirmed medium should be the default to maintain backward compatibility with existing scripts and automation.

Who it's for

The contributor wired together an existing but unused recording-export-quality.ts scaffold that was already in the codebase, completing the path from CLI argument through the command layer, client, daemon validation, and finally to the Swift exportPresetName() function.

When & where

This is a draft PR (not yet merged) submitted to callstack/agent-device as PR 816. The work was validated locally with 2581 passing unit tests across 264 files, full typecheck, oxlint, and format checks all passing. Swift compilation was verified with local swiftc.

How

The implementation plumbs the enum flag through four layers: the CLI accepts --export-quality with medium or high, the command passes it to the client, the daemon validates it and rejects invalid values, and finally the resize step maps medium to AVAssetExportPresetMediumQuality and high to HighestQuality. End-to-end video re-encoding tests are deferred to the repository CI since local testing lacks a simulator.

Takeaway

This shows how to surface a previously scaffolded feature by connecting it end-to-end through a multi-layer architecture. The approach validates early (daemon level), maintains backward compatibility through sensible defaults, and keeps related-but-distinct concerns (export quality vs capture resolution) in separate flags.

Draft PR: https://github.com/callstack/agent-device/pull/816

Building an AI agent?

I'm packaging how I ship them into one kit. Early access:

AI Agent Starter Kit →