Skip to content

Codex Retain 0.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Nov 10:13
· 2 commits to main since this release

Codex Retain 0.2.0

Universal local Codex client and version compatibility release. Removes the
hardcoded codex-cli 0.153.4 version pin, exact SQLite schema checksum check,
and private triggers inside Codex's database so Codex Retain works across Codex
CLI, macOS Codex Desktop (/Applications/Codex.app), IDE extensions, and
past, current, and future Codex versions sharing $CODEX_HOME.

What changed

  • Capability-based storage contract (no version pin): Automatically selects
    the highest numeric state_<N>.sqlite in $CODEX_HOME, validates the core
    threads contract (id PK, rollout_path, archived, archived_at), and
    dynamically adapts to optional columns and tables (name, title,
    history_mode, is_pinned, thread_section_id, thread_sections,
    thread_spawn_edges, backfill_state, _sqlx_migrations).
  • Forward-compatible safeguards: Dynamically discovers "Pinned" sections
    in thread_sections, protects unknown protective columns on threads (such
    as pinned_at or is_starred), skips unknown per-thread history_mode
    values without blocking eligible peers, detects child tables with
    ON DELETE RESTRICT or NO ACTION foreign keys to threads before staging
    any files, and fails closed on missing core columns, failed _sqlx_migrations,
    incomplete backfill_state, or self-referential ON DELETE CASCADE.
  • External sidecar epoch tracker (state_dir/tracker.sqlite): Moves
    tracked archive epochs out of Codex's database into a private (0o600,
    DELETE journal mode, synchronous=FULL) SQLite sidecar inside the utility
    state directory. Injects zero codex_retain_* tables or triggers into Codex's
    database, survives state_5.sqlite -> state_6.sqlite upgrades cleanly, and
    quietly syncs archive/restore transitions during paused scheduled runs (opening
    Codex strictly read-only).
  • Codex Desktop and CLI-less operation: Makes --codex-bin optional
    (diagnostics only) so Desktop-only and IDE-only setups work without codex on
    PATH and scheduled runs never spawn codex --version or require Node.js.
    doctor and status auto-discover local CLI and macOS Codex Desktop
    installations and report their versions.
  • Codex Desktop pin protection: Reads $CODEX_HOME/.codex-global-state.json
    when present (O_NOFOLLOW, regular-file validation, 16 MiB cap, stamp-cached
    with live re-verification under BEGIN IMMEDIATE), protecting Desktop-pinned
    threads across known JSON shapes and failing closed on unreadable, corrupt, or
    symlinked global state.
  • Seamless 0.1.x upgrade: Existing 0.1.x policies with legacy
    codex_retain_* tables/triggers in state_5.sqlite remain readable during
    read-only status/preview and automatically migrate their tracked epochs
    into tracker.sqlite while removing legacy triggers on the first run (or
    disable/uninstall).

Update

brew update
brew upgrade dankosik/codex-retain/codex-retain
codex-retain --version
codex-retain status

Installer users can rerun the installer at the same installation directory.
Installation does not enable retention. Existing policies, exclusions, and
captured archive periods are preserved; upgrading from 0.1.x no longer
requires disabling Retain before Codex upgrades.

Compatibility and verification

  • macOS 15+ release archives for Apple Silicon (aarch64-apple-darwin) and
    Intel (x86_64-apple-darwin), covering Codex CLI, Codex Desktop, and IDE
    clients sharing $CODEX_HOME.
  • Linux remains experimental for read-only core, doctor, and preview paths;
    destructive commands and scheduling remain macOS-only.
  • All automated validation uses synthetic profiles (240 Rust unit and
    integration tests including tests/universal.rs, plus release and skill
    maintenance suites).