Skip to content

Paginated Codex history stops projecting after provider metadata relabeling #4311

Description

@luvs01

Client or integration

Codex App

Area

Other

Summary

OpenCodex provider-history relabeling appends a cloned session_meta record with its old top-level ordinal (observed: 0) to a Codex paginated rollout. The native history projector stops at that record while the raw rollout continues receiving messages. Two long-running conversations became stale in the native UI and thread/read despite intact later messages. A second symptom was Model provider opencodex not found after the provider table was removed while a thread still referenced it.

Reproduction

  1. Use a Codex App version with paginated history and a rollout containing monotonically increasing top-level ordinals.
  2. Exercise an OpenCodex provider-history transition, such as authless Desktop startup or restoration.
  3. src/codex/history-provider.ts:updateSessionMeta copies the latest session_meta, changes provider/source/timestamp, and calls appendRolloutLine without allocating a new ordinal.
  4. Native projection refuses the appended ordinal 0. The app continues appending raw records, but native history queries stay at the old projection boundary.

Observed boundary A: next ordinal 40625, actual 0. Boundary B: next ordinal 31617, actual 0. The offending records are same-thread session_meta with model_provider=opencodex and history_mode=paginated. Service logs independently record authless history relabeling and restoration during the incident.

With Codex completely closed, rewriting only ordinal digits in each unprojected suffix restored native history reads. Message text, IDs, timestamps, and earlier bytes were preserved; the native projector subsequently advanced beyond both boundaries. This is incident recovery evidence, not a recommendation to rewrite live rollouts.

Do not fix this by merely reading the last ordinal and appending N+1: the native writer may concurrently allocate the same ordinal or retain a stale cursor. The durable solution needs native-writer ownership, or no external metadata mutation for paginated history. A transition must also retain the provider definition while any existing thread depends on it.

Version

OpenCodex 2.51.0; source still contains the append path at dev 7a0513c. App Codex executable 0.153.4; OpenCodex's configured CLI reports 0.146.0.

Operating system

Windows 11, kernel build 26100, x64

Provider and model

Provider-history transition between openai and opencodex; model independent.

Logs or error output

failed to project durable rollout: thread history projection expected ordinal 40625, got 0
failed to load configuration: Model provider `opencodex` not found
Injected opencodex as default provider into Codex config (authless Desktop mode: requires_openai_auth = false).
Codex resume history: 17 thread(s) made visible for opencodex; originals backed up for restore.
history-migration: restored original provider metadata for 17 manifest-backed thread(s).

Screenshots and supporting files

No private conversation payloads attached. Minimal regression fixtures can use one session_meta ordinal 0 followed by event ordinal 1. Both problematic suffixes parsed cleanly and contained no compacted/ocx1 records, so direct compaction-content loss was not observed.

Redacted configuration

{"codexDesktopAuthless": true}

The incident also involved subsequent removal of codexDesktopAuthless/codexClientCompaction. The deletion provenance does not identify every historical toggle. Compaction-only mode in current inject.ts skips history relabeling; authless mode does not.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions