Skip to content

Allow querying soft-deleted sessions via CLI and/or optional config #1471

Description

@msgongora

Problem / motivation

Harnesses like Claude Code regularly prune or clean up older transcript files on disk. When agentsview sync reconciles provider roots and finds a file missing, it sets deletion_cause = 'source_missing' and populates deleted_at.

While AgentsView's local-first storage design intentionally preserves all messages, tool calls, and tokens in sessions.db, all standard CLI commands (session search, session list, session get, session messages) filter out records where deleted_at IS NOT NULL. This makes historical conversations invisible (from CLI and Web) even though the data remains intact in the SQLite archive.

Proposed solution

  1. CLI Flag (--include-deleted):
    Add --include-deleted to agentsview session search and agentsview session list so CLI queries can optionally include tombstoned/soft-deleted sessions.
  2. Config Entry (preserve_missing_sources):
    Add an optional setting in config.toml:
      preserve_missing_sources = true
    When enabled, reconciliation leaves missing files active instead of tagging them with source_missing tombstones.

Alternatives considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions