Skip to content

chore: implement sub-thread cleanup for parent thread deletion #73

Closed

Description

@larryro

Context

When a parent thread is deleted, sub-threads created for specific tasks (like workflow creation) are not cleaned up. This can lead to orphaned threads accumulating over time.

Considerations

  1. Debugging context: Sub-threads may contain useful debugging context that should be preserved for some period
  2. Thread deletion API: We'd need to implement a thread deletion API that doesn't exist yet
  3. Cleanup timing: Need to decide between immediate deletion vs scheduled cleanup (e.g., after 30 days)
  4. Volume: Currently low - only created when users ask for workflow creation via chat

Proposed Solutions

  1. Immediate cleanup: Delete sub-threads when parent is deleted
  2. Soft delete: Mark sub-threads as orphaned, clean up via scheduled job after retention period
  3. Cascade on read: Check for parent existence when loading sub-thread, clean up if missing

Related

  • Discussed in PR #(relevant PR number)

Created as follow-up from code review

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

Metadata

Metadata

Assignees

Labels

improvementpriority: lowservice: platform

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions