Skip to content

feat(coding-agent): delete child sessions with their parent - #118

Merged
Issacboy123 merged 2 commits into
docs/persistent-subagent-storagefrom
feat/delete-owned-subagent-sessions
Aug 28, 2026
Merged

Issacboy123 merged 2 commits into
docs/persistent-subagent-storagefrom
feat/delete-owned-subagent-sessions

Conversation

@Issacboy123

@Issacboy123 Issacboy123 commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Prevents saved child sessions from being left behind when their parent session is deleted. Diffex now moves the selected parent's child-session directory to trash before deleting the parent. It keeps the parent when child cleanup is unsafe or fails, and clearly reports when the child data was removed but the parent could not be deleted.

Reasoning

Deleting owned child data before the parent prevents an otherwise unreachable namespace from being orphaned. Deriving the target from the validated parent header, proving containment, and rejecting link-like components prevents deletion from escaping the selected parent's ownership boundary. Reusing the session selector's trash behavior keeps cleanup recoverable; failing closed before parent deletion preserves the user's entry point when child cleanup cannot be verified.

Changes

  • Added a validated helper that derives and checks the exact parent-owned child-session directory from the parent session header.
  • Moved an existing owned directory to trash before deleting the parent and treated an absent namespace or owned directory as success.
  • Rejected unsafe namespace and owned-directory files or links and verified that a reported trash operation actually removed the directory.
  • Retained the parent when owned cleanup failed and reported partial deletion when parent removal failed or threw after cleanup.
  • Preserved sibling child namespaces and kept child files excluded from normal session listing.
  • Added focused deletion, containment, ordering, absence, cleanup-failure, partial-failure, and listing regressions.

Testing

  • node ../../node_modules/vitest/dist/cli.js --run test/suite/subagent-persistence.test.ts test/suite/subagent-services.test.ts test/suite/subagent-registration.test.ts test/suite/agent-session-harness-version.test.ts test/session-manager/fork-branch.test.ts test/session-selector-path-delete.test.ts
  • npm run check

@Issacboy123 Issacboy123 added enhancement New feature or request coding-agent labels Aug 25, 2026
@Issacboy123 Issacboy123 self-assigned this Aug 25, 2026
@Pepps233
Pepps233 force-pushed the feat/delete-owned-subagent-sessions branch 2 times, most recently from 779a494 to f847a7e Compare August 25, 2026 16:42
@Pepps233
Pepps233 self-requested a review August 25, 2026 16:44

@Pepps233 Pepps233 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needed, thank you

@Issacboy123
Issacboy123 force-pushed the feat/delete-owned-subagent-sessions branch from f847a7e to 90a3467 Compare August 27, 2026 10:54
@Issacboy123
Issacboy123 force-pushed the feat/delete-owned-subagent-sessions branch from 90a3467 to 101a69e Compare August 27, 2026 23:11
@Issacboy123
Issacboy123 merged commit 08de090 into main Aug 28, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding-agent enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants