Skip to content

Instant replay: a rolling recording buffer and save_replay to keep the last N seconds after something fails #197

Closed

Description

@TMHSDigital

Why it matters

Today an agent has to decide to record before the interesting thing happens. The most valuable footage is usually the 30 seconds before a flaky test failed, an app crashed or a UI glitched, and by then it is too late to start recording. An instant-replay buffer, like the "save the last 30 s" feature in ShadowPlay or OBS, lets the agent capture after the fact.

Who it's for:

  • Agents running long UI-test or automation loops.
  • QA engineers chasing intermittent bugs.
  • Game developers using the Steam trailer presets.

Rationale

Suggested approach

  • start_recording { replayBufferSec: 60 } records into rotating 2-second segments in the session's temp dir.
  • A new save_replay { id, lastSec } tool writes the last N seconds to an MP4 (plus a sliced events file) without stopping the buffer.
  • stop_recording on a buffer session discards the segments unless save: true is passed.
  • Bound disk use, and document the overhead.

Done when

  • An agent can run a buffer for an hour with disk use bounded to about the buffer length.
  • save_replay returns a playable clip of the requested length within about one second.
  • The docs have a "catch a flaky failure" workflow recipe.

Activity

  1. added
    feature
    effort: medium
    impact: high
    on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort: mediumfeatureimpact: highpriority: high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions