Repository navigation
Description
Summary
Add --replay <sec> (and an Action replay-seconds input): start with replayBufferSec instead of a full capture and no cap, then on exit call save_replay { sessionId, lastSec } to produce recording.mp4 before the GIF/contact sheet/bug_report steps (save on failure only unless --artifacts always).
Where
src/cli.ts:93-112src/cli.ts:522-531src/cli.ts:468-475action.yml:11-89src/tools/startRecording.ts:153-162src/tools/startRecording.ts:215-221src/tools/saveReplay.ts:13-22src/tools/startRecording.ts:131-206
Problem
record starts the capture with only target, fps, output, overwrite, maxDurationSec, events, perf, logs (cli.ts:522-531); there is no flag for replayBufferSec, which start_recording supports ("Instant replay: keep only the last N s (bounded disk) for save_replay", startRecording.ts:215-221). The default cap is 3600 s (help text cli.ts:105-106), and when a run outlives it earlyEndWarning says "the GIF and contact sheet show the end of the recording, not the end of the run. Raise --max-duration (0 = no cap)" (cli.ts:474). The Action inputs (action.yml:11-89) mirror the CLI and have no replay input either.
Who benefits
For multi-hour E2E suites the user must choose between losing the failure at the end (cap hit) or recording the whole run to disk on a CI runner (--max-duration 0), even though the artifacts only ever use the last --last seconds (default 30). The replay buffer was built for exactly this shape.
Proposal
Add --replay <sec> (and an Action replay-seconds input): start with replayBufferSec instead of a full capture and no cap, then on exit call save_replay { sessionId, lastSec } to produce recording.mp4 before the GIF/contact sheet/bug_report steps (save on failure only unless --artifacts always). Validate --replay >= --last and the MIN/MAX_REPLAY_SEC bounds at parse time like --max-duration. Note in help that it needs gdigrab/ddagrab, not wgc.
Also: CLI record and the Action cannot pass audio, backend, elements or quality
start_recording supports quality (131), audio (135), elements ("Name the UI element each click hits", 189), cursor (190), backend (194), encoder (202); the CLI forwards none of them (cli.ts:522-531) and the help lists no such flags (cli.ts:93-112). The help for --target lists only full | monitor:<i> | window:<title> | region:x,y,w,h, not window:exe= / window:hwnd=, though the value is passed through unchanged.
Add --audio, --elements, --backend <auto|gdigrab|ddagrab|wgc> and --quality <draft|standard|high> to record, forwarded verbatim (start_recording validates), plus matching Action inputs and the docs/CI page rows; list exe=/hwnd= in the --target help. npm run docs covers the tool tables; the Action input table is hand-written.
Related: #355
Getting started
- Relevant files:
src/cli.ts,action.yml - Run tests:
npm test(alsonpm run typecheckandnpm run lint); see CONTRIBUTING.md - If you change a tool's schema or description, run
npm run docs
Filed by repo-audit/full-audit at f0e5ebd. Severity: medium. Effort: M. audit-key: enhancement|src/cli.ts|record --replay
Activity