From e91bb6b94781cbe1f22fe4b901ed4801d7931933 Mon Sep 17 00:00:00 2001 From: jif-oai Date: Fri, 5 Dec 2025 13:57:24 +0000 Subject: [PATCH] fix: ignore ghost snapshots in token consumption (#7638) --- codex-rs/core/src/context_manager/history.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/codex-rs/core/src/context_manager/history.rs b/codex-rs/core/src/context_manager/history.rs index b9a9c58f6..9b75c836a 100644 --- a/codex-rs/core/src/context_manager/history.rs +++ b/codex-rs/core/src/context_manager/history.rs @@ -87,6 +87,7 @@ impl ContextManager { let items_tokens = self.items.iter().fold(0i64, |acc, item| { acc + match item { + ResponseItem::GhostSnapshot { .. } => 0, ResponseItem::Reasoning { encrypted_content: Some(content), ..