Skip to content

Permanently delete archived sessions with merged pull requests after a retention period #334352

Closed

Description

Summary

Follow up to #334341 by permanently deleting archived agent sessions whose associated pull requests have merged after a configurable retention period. This would align the Agents Window lifecycle more closely with the GitHub app while preserving auto-archive as a reversible grace period before deletion.

Proposed behavior

  • Only consider sessions that are already archived and whose associated pull requests are all merged.
  • Require an additional retention period after archival before permanent deletion.
  • Keep permanent deletion disabled by default.
  • Revalidate pull request state, archived state, activity, and the current setting immediately before deletion.
  • Use the existing session deletion lifecycle so persistence, provider callbacks, worktree cleanup, and client updates remain consistent.
  • Provide an enterprise policy for administrators to disable or configure permanent deletion.

Design considerations

  • Define behavior for local, remote, and externally sourced sessions.
  • Decide whether associated worktrees and branches are deleted, retained, or independently configurable.
  • Surface clear user messaging because deletion is irreversible.
  • Handle partial failures without reporting a successful deletion.
  • Ensure active or recently restored sessions can never be deleted from a stale candidate list.

Related: #334341

Activity

  1. added
    feature-request
    on Sep 3, 2026
  2. meganrogge commented on Sep 3, 2026

    @meganrogge
    CollaboratorAuthor

    Permanent deletion is now included in #334341. The PR preserves a full archive grace period, only deletes sessions auto-archived by the feature, revalidates merged/session/configuration state inside the deletion critical section, and skips deletion while a preserved worktree remains. Closing this follow-up as superseded by the PR.

  3. locked and limited conversation to collaborators on Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

agents-windowfeature-requeston-testplan

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions