Skip to content

Add a default maximum duration to start_recording #82

Closed

Description

@TMHSDigital

Problem

start_recording has no duration limit. A recording ends only through stop_recording or when the process dies. Agents forget or lose session ids, context gets compacted, and tools time out. A forgotten capture keeps recording the screen and filling the disk.

Why it matters

This is the defense-in-depth counterpart to the disconnect bug: even with a proper shutdown path, a long-lived agent session can leave a recording running for hours. Given the threat model, capture should be time-bounded by default.

Suggested approach

  • Add maxDurationSec to start_recording, passed to ffmpeg as -t so the file finalizes cleanly. Default to a conservative value (e.g. 30 min), overridable per call and through SCREENCAST_MAX_RECORDING_SEC.
  • When ffmpeg exits because of this limit, record the session as stopped with reason: "max_duration" so get_session or stop_recording report it clearly.
  • Optionally refuse to start when free space in SCREENCAST_HOME is below a threshold.

Done when

A recording that is never stopped finalizes itself at the limit with a playable file and an explicit reason on the session record. The README documents the default.

Activity

  1. added
    enhancement
    on Sep 26, 2026
  2. TMHSDigital commented on Sep 26, 2026

    @TMHSDigital
    OwnerAuthor

    Related: #76 (recording survives client disconnect). This is the defense-in-depth counterpart.

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

    enhancementpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions