Skip to content

bug(runtime): Codex checkpoint gates do not bind the credential identity — re-login on the same connection replays the previous account compressed context #6385

Open

Description

@ggbdpq

What happened

The Codex checkpoint replay gates (packages/runtime/src/history-compact-checkpoint.ts, introduced by #6362) authorize a compressed-history checkpoint for cross-model reuse by comparing connectionId plus the provider-advertised comp_hash — but they do not bind the checkpoint to the credential identity, so a re-login to a different ChatGPT account on the same connection row replays the previous account's encrypted compressed context (encryptedContent/itemId) into the new account's requests.

The same codebase defines the authoritative replay identity for provider state in execution-model-authority.ts (providerStateIdentity = connectionId + providerType + endpoint + credentialId + revision, with the comment "Provider state from one wire cannot replay on another") — and that identity is already in scope in the compactor options (it feeds the reasoning-replay gate, compatibleProviderReasoningReplayEventIds), but the checkpoint gates don't use it.

Note on provenance: the old gate (connectionId + modelId) had the same hole — #6362 did not introduce it. But #6362 rewrote this exact function, had the identity in hand, and left it unbound; the credential-rotation path (logout/login on the same connection, which does not force a model re-discovery — compounding #6362's freshness-gate observation) is a real, ordinary user sequence.

Deterministic reproduction

Connect a Codex OAuth connection, run a compaction that produces a checkpoint, log out and log back in as a different account on the same connection (connectionId unchanged, credentialId changes), open the session with the checkpoint, and send: the checkpoint passes the gates and its encrypted context is replayed to the new account. A unit test rotating the credential identity between capture and replay pins this (red on main).

Root cause

The replay identity used elsewhere for provider state (and available in the compactor options) is narrower than what the checkpoint gates check — connectionId equality says nothing about which credential produced the checkpoint.

Suggested fix

Fold providerStateIdentity (or at minimum its credentialId+revision components) into the checkpoint capture record and the gate comparison, the same way the reasoning-replay gate binds it. Checkpoints captured before the field exists stay on the legacy path (same-model-only), which is the conservative default.

Source

Found by an AI-assisted read-only audit (GLM-5.3-Flash via ZCode) over main@112883c85 while auditing #6362's implementation; the identity definition, the gate comparison, and the rotation path were re-verified line by line before filing.

Activity

  1. ggbdpq commented on Oct 27, 2026

    @ggbdpq
    ContributorAuthor

    take

  2. added a commit that references this issue on Nov 24, 2026
    ef5457b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions