Repository navigation
fix(runtime): pin the wire identity into Codex checkpoints so a re-login stops replaying the previous account state - #6386
Conversation
…ntity The cross-model Codex checkpoint gate compared only connectionId plus the compaction hash, so a connection re-authenticated with a different account (rotation without changing connectionId) kept replaying the previous account's encrypted compaction context (encryptedContent/itemId) on the new account's wire. Capture now pins the route's authoritative providerStateIdentity (connectionId + providerType + endpoint + credentialId + revision, the same identity the reasoning replay gate already binds) into the checkpoint's provider state next to codexCompactionHash, and both replay gates reject a pinned checkpoint unless the current route states the exact same identity — a route that cannot state one fails closed. The compaction hash and same-model checks are unchanged and still compose with the identity match. Checkpoints minted before this change carry no identity and keep the legacy same-model/hash path, as the issue declares. Fixes apache#6385 Generated-by: GLM-5.3-Flash (ZCode)
|
Rebase & full-chain verification refresh (2026-11-25) Context: upstream Rebased onto
Not verified: live Codex re-login end-to-end locally; covered by the gate-level suites over real captured state, CI runs the same files. Attribution: original fix by @ggbdpq; rebase & verification refresh by GLM-5.3-Flash (ZCode). |
70cb8e6 to
ef5457b
Compare
Summary
The cross-model Codex checkpoint gate (
canReplayHistoryCompactCheckpointForModel, #6362) compared onlyconnectionId+ compaction hash. Re-authenticating the same connection with a different account kept replaying the previous account's encrypted compaction context (encryptedContent/itemId) on the new account's wire. Capture now pins the route's authoritativeproviderStateIdentity(connectionId + providerType + endpoint + credentialId + revision — the same identity the reasoning replay gate already binds) into the checkpoint's provider state; both replay gates reject a pinned checkpoint unless the current route states the exact same identity, failing closed when a route cannot state one. Pre-existing checkpoints without the pinned identity keep the legacy same-model/hash path, as declared in the issue. Compaction-hash and same-model checks are unchanged and compose with the identity match.Fixes #6385
Verification
history-compact-checkpoint+openai-codex-history-compactorsuitestsc -p tsconfig.json --noEmit(runtime, runtime-host)npm run format:check(2582 files)npm run check:asf-headers(4706 files)AI use
Implemented with GLM-5.3-Flash (ZCode); the identity definition, the gate comparison, and the rotation path were re-verified line by line before filing #6385.
Checklist