mirror of
https://github.com/openai/codex.git
synced 2026-11-03 00:21:31 +00:00
1 parent
99f47d6e9a
commit
1fc72c647f
1 file changed
+5
-1
@@ -97,7 +97,11 @@ impl ContextManager {
|
||||
}
|
||||
| ResponseItem::Compaction {
|
||||
encrypted_content: content,
|
||||
} => estimate_reasoning_length(content.len()) as i64,
|
||||
} => {
|
||||
let reasoning_bytes = estimate_reasoning_length(content.len());
|
||||
i64::try_from(approx_tokens_from_byte_count(reasoning_bytes))
|
||||
.unwrap_or(i64::MAX)
|
||||
}
|
||||
item => {
|
||||
let serialized = serde_json::to_string(item).unwrap_or_default();
|
||||
i64::try_from(approx_token_count(&serialized)).unwrap_or(i64::MAX)
|
||||
|
||||
Reference in new issue
Block a user