Repository navigation
Done
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- On a version prior to
v0.1.12, create and run several threads, then delete them via the UI (which displays "This permanently clears conversation history for this thread."). - Let background compaction run on the older version so
~/.t3/userdata/compacted-atis updated recently. - Upgrade and restart into
v0.1.12(verified on macOST3 Code (Beta) 0.1.12, also still present onmain @ dca3ab20). - Inspect
~/.t3/userdata/statev2.sqliteread-only after startup.
Expected behavior
- Upgrading to
v0.1.12should immediately detect and purge previously deleted threads on startup (or via an explicit one-time migration / startup sweep), rather than leaving deleted conversation content and FTS5 index entries intact for up to 6 hours waiting forCOMPACTION_INTERVAL. - When the UI states "This permanently clears conversation history for this thread", either all user-identifying history for that thread should be cleared promptly, or the UI should accurately disclose what remains (e.g., thread tombstone metadata, kept
run.updated(status = 'running') events, and external provider transcripts stored by underlying CLIs such as~/.claude/projectsorCODEX_HOME/sessions).
Actual behavior
- Up to 6-hour retroactive purge delay after upgrading to
v0.1.12:- In
apps/server/src/persistence/DatabaseStorage.ts,firstCompactionDelayis computed from the existingcompacted-attimestamp plusCOMPACTION_INTERVAL(hours(6)). - Because pre-
v0.1.12deletions never enqueuedthread-content.purge, and the previous version already updatedcompacted-at, upgrading tov0.1.12leaves all previously deleted threads completely unpurged instatev2.sqliteuntil the next 6-hour compaction window arrives. - Observed on a live
v0.1.12install upgraded shortly after an earlier compaction: 7 previously deleted threads still had their original titles intact along with 40 rows inorchestration_v2_projection_messages, 24 rows inorchestration_v2_message_search(FTS5), 165 rows inorchestration_v2_projection_turn_items, 26 rows inorchestration_v2_projection_runs, and 131 rows inorchestration_v2_projection_nodes. Running thepurgeableThreadsSQL fromapps/server/src/orchestration-v2/ProjectionMaintenance.tsmatched all 7/7 threads, confirming they are simply waiting on the 6-hourcompacted-attimer.
- In
- Residual data & UI expectation mismatch even after purge:
ProjectionMaintenance.tsintentionally retainsorchestration_eventsrows whereevent_type = 'run.updated' AND json_extract(payload_json, '$.status') = 'running'(for Codex usage history) and keeps thread tombstones inorchestration_v2_projection_threads.- External provider transcripts on disk (
~/.claude/projects,CODEX_HOME/sessions, etc.) are not cleared or mentioned in the delete confirmation dialog, even though the dialog says "This permanently clears conversation history for this thread."
Note — not a duplicate of #17845 or #32378: #17845 was closed as completed and
v0.1.12shipspurgeDeletedThreadfor newly deleted threads, but this specifically reports the post-upgrade retroactive purge delay (compacted-at+ 6h) and the residual-data / external-CLI disclosure gap still reproducible inv0.1.12(main @ dca3ab20).
Impact
Major degradation or frequent failure
Version or commit
v0.1.12 (also verified in main @ dca3ab2)
Environment
macOS (arm64), T3 Code (Beta) Desktop v0.1.12, Orchestrator V2 (statev2.sqlite)
Logs or stack traces
# Read-only inspection of ~/.t3/userdata/statev2.sqlite after upgrading to v0.1.12:
orchestration_v2_projection_threads (deleted_at IS NOT NULL): 7
orchestration_v2_projection_messages (for deleted threads): 40
orchestration_v2_message_search FTS5 (for deleted threads): 24
orchestration_v2_projection_turn_items (for deleted threads): 165
orchestration_v2_projection_runs (for deleted threads): 26
orchestration_v2_projection_nodes (for deleted threads): 131
# Running purgeableThreads query matched 7 / 7, blocked only by compacted-at + COMPACTION_INTERVAL (6h).
Workaround
Wait up to 6 hours for the next scheduled pruneEventStore run after compacted-at expires, or manually clear external provider session directories if full local erasure is required.
Suggested fix & priority context
- Priority context: Data retention after clicking "Delete" is currently a high-visibility privacy/trust concern in public audits of T3 Code. Users who upgrade specifically to get the [Bug]: Deleting a thread says it permanently clears its history, but V2 keeps every event and projection row #17845 fix and immediately inspect
statev2.sqlitestill see all of their previously deleted conversations and titles intact for hours, making the fix appear broken. - Concrete low-risk fix:
- In
DatabaseStorage.ts(or a lightweight startup sweep / one-time schema version marker), runpurgeThreads(undefined)promptly after startup when unpurged deleted threads exist, without waiting forcompacted-at + COMPACTION_INTERVAL. - Add a short note in the delete confirmation dialog (or docs) clarifying that underlying CLI providers may retain their own local session logs outside T3 Code's database, and consider offering an explicit "Compact & purge deleted history now" action in Settings > Maintenance.
- In
Metadata
Metadata
Assignees
Labels
No labels
Activity