mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
tests
This commit is contained in:
@@ -71,7 +71,14 @@ impl SessionState {
|
||||
pub(crate) fn token_info_and_rate_limits(
|
||||
&self,
|
||||
) -> (Option<TokenUsageInfo>, Option<RateLimitSnapshot>) {
|
||||
(self.token_info(), self.latest_rate_limits.clone())
|
||||
let info = self.token_info().and_then(|info| {
|
||||
if info.total_token_usage.is_zero() && info.last_token_usage.is_zero() {
|
||||
None
|
||||
} else {
|
||||
Some(info)
|
||||
}
|
||||
});
|
||||
(info, self.latest_rate_limits.clone())
|
||||
}
|
||||
|
||||
pub(crate) fn set_token_usage_full(&mut self, context_window: i64) {
|
||||
|
||||
@@ -817,7 +817,7 @@ async fn auto_compact_triggers_after_function_call_over_95_percent_usage() {
|
||||
|
||||
let server = start_mock_server().await;
|
||||
|
||||
let context_window = 100;
|
||||
let context_window = 20_000;
|
||||
let limit = context_window * 90 / 100;
|
||||
let over_limit_tokens = context_window * 95 / 100 + 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user