Skip to content

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions