Skip to content

Sessions: Codex v1-source replay is a data migration path #2700

Description

@ScriptedAlchemy

crates/tracedecay-sessions/src/runtime/hosts/codex/observation.rs still reads the retired Codex source identity, ObservationSourceIdentityV1::for_provider(codex, session), on every admission. When the v2 cursor from codex_observation_source_v2 lags, it replays current user messages into v2. The functions involved are legacy_cursor_matches_current_file, replay_advanced_current_user_messages, and CodexAdmissionMode::CurrentUserMessageReplay, all added 2026-09-04 in 9786266 ("make Codex prompt recovery durable").

This carries data from an old identity into the new one, which the product rules disallow: old on-disk shapes get a typed reset refusal or a rebuild, never a migration. Deleting the replay alone would re-admit v1-covered rollouts from byte 0 under v2 and could duplicate observations. The cutover therefore needs a decision first: either refuse stores that still hold v1 Codex source cursors with the scoped tracedecay wipe --stale --yes session-store reset, or prove that re-admission under v2 is idempotent. After that, delete the replay mode, the v1 cursor read, and their tests.

Found by the legacy-api-sweep sessions lane.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions