You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Permanently delete archived sessions with merged pull requests after a retention period #334352
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.
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.
Activity
meganrogge commentedon Sep 3, 2026
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.