Skip to content

feat(storage): restore quarantined archived sessions (phase 2.1 of #42)#558

Open
Wibias wants to merge 3 commits into
lidge-jun:devfrom
Wibias:feat/storage-phase2.1-restore
Open

feat(storage): restore quarantined archived sessions (phase 2.1 of #42)#558
Wibias wants to merge 3 commits into
lidge-jun:devfrom
Wibias:feat/storage-phase2.1-restore

Conversation

@Wibias

@Wibias Wibias commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add GET /api/storage/trash and POST /api/storage/trash/restore to list and restore Phase 2 quarantine entries under CODEX_HOME/.trash/<epoch>/ (relative paths only).
  • Restore moves JSONL files back to archived paths, re-inserts threads (+ satellites when satellite-backup.json is present), removes the trash entry on success, and returns 409 when Codex DBs are busy.
  • Storage page Quarantine panel with Restore + confirm, i18n for all locales that already had storage keys, and docs note that quarantine is restorable from the dashboard.

Closes part of #42 (Phase 2.1 only — no Phase 3 auto-policy/purge).

Test plan

  • bun test --isolate for storage-cleanup, api-storage-cleanup, api-storage, storage-scanner
  • bun run typecheck
  • Manual: quarantine an archived session on Storage, confirm it appears under Quarantine, Restore, verify JSONL + thread return
  • Manual: with Codex holding state_*.sqlite, confirm restore returns busy / 409

Summary by CodeRabbit

  • New Features

    • Added an in-app Quarantine section to the Storage page.
    • Users can review quarantined entries and restore selected files and threads.
    • Added clear restore confirmations, status updates, and error messages.
  • Bug Fixes

    • Prevented cleanup and restoration while active storage data is locked.
    • Added safeguards for invalid entries, missing data, and destination conflicts.
  • Documentation

    • Updated web dashboard guidance across supported languages to reflect in-app quarantine restoration.

…dge-jun#42)

Add trash list/restore APIs, Storage GUI quarantine panel, and round-trip tests so default cleanup can be undone without Phase 3 purge.
@github-actions github-actions Bot added the enhancement New feature or request label Jul 27, 2026
@coderabbitai

This comment was marked as outdated.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Wibias added 2 commits July 27, 2026 18:02
… races

Keep satellite backups for quarantine restore, snapshot full thread rows and state dependents, remap satellite DB paths, and make satellite failures retryable. Drop duplicate trash probing so Storage abort/generation ownership stays correct.
Use link+unlink no-replace for trash restore so a raced dest cannot be overwritten, and raise timeouts for multi-satellite cleanup tests that overrun 5s on Windows CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant