Skip to content

Size-based rotation for warp.log within a session (currently startup-only) #10879

@david-engelmann

Description

@david-engelmann

Pre-submit Checks

Describe the solution you'd like?

warp_logging::rotate_log_files() rotates warp.log and its telemetry siblings once at app startup: the previous session's log becomes .old.0, older ones shift up to .old.N, and the oldest gets discarded. That model works well for users who restart Warp frequently — each session gets its own log file.

For long-running sessions (developers who keep Warp open for days or weeks), the active warp.log grows unboundedly during a single session, with no checkpoints in between. The startup rotation never fires until the next restart.

Proposal: add an in-session size-based rotation mode to warp_logging, complementing the existing startup rotation. When the active warp.log exceeds a configured size threshold mid-session, it's rotated to an in-session sibling (e.g. warp.log.in_session.N) and a fresh active file is opened. The startup .old.N semantics that log-bundle uploads and other UX depend on stay untouched.

Is your feature request related to a problem? Please describe.

Two related reports for other log files exist:

Both of those operate on a different rotation engine than warp.log, but the underlying user complaint is the same: Warp's diagnostic data grows without bound during long sessions. Capping warp.log at e.g. 50 MiB × 5 rotated copies would bound it at ~300 MiB even across multi-day sessions, while preserving the per-session file boundary at startup that today's UX (e.g. log-bundle uploads) relies on.

Additional context

This complements (does not replace) the MCP/LSP rotation work. Different file, different rotation engine, but the same principle: cap on-disk footprint during long sessions while preserving the current per-session semantics.

Sketch of the implementation surface:

  • Extend LogConfig with optional max_file_size_bytes (or equivalent threshold)
  • Plumb that to the log writer (e.g. tracing-appender's rolling appender, or a manual periodic size check)
  • Rotation pattern: e.g. warp.log.in_session.N to distinguish from the existing startup .old.N files

Operating system (OS)

macOS

How important is this feature to you?

3

Warp Internal (ignore) - linear-label:39cc6478-1249-4ee7-950b-c428edfeecd1

Ignore

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:performanceGeneral application performance, responsiveness, and resource usage.enhancementNew feature or request.ready-to-implementThe issue is ready for implementation work.repro:highThe report includes enough evidence that the issue appears highly reproducible.triage-reviewedtriagedIssue has received an initial automated triage pass.warp:auto-triage-review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions