Plumb compaction counts to TUI clients

This commit is contained in:
canvrno-oai
2026-07-08 14:54:19 -07:00
parent 358575465c
commit d5e7342080
20 changed files with 170 additions and 6 deletions
+5
View File
@@ -450,6 +450,11 @@ impl CodexThread {
self.codex.session.token_usage_info().await
}
/// Returns the current context-window generation for this thread.
pub async fn context_window_number(&self) -> u64 {
self.codex.session.context_window_number().await
}
/// Records a user-role session-prefix message without creating a new user turn boundary.
pub(crate) async fn inject_user_message_without_turn(&self, message: String) {
let item = ResponseItem::Message {
+7 -2
View File
@@ -1273,6 +1273,12 @@ impl Session {
state.token_info()
}
/// Returns the current context-window generation for this session.
pub(crate) async fn context_window_number(&self) -> u64 {
let state = self.state.lock().await;
state.auto_compact_window_number()
}
pub(crate) async fn get_estimated_token_count(
&self,
turn_context: &TurnContext,
@@ -3487,9 +3493,8 @@ impl Session {
}
pub(crate) async fn current_window_id(&self) -> String {
let state = self.state.lock().await;
let thread_id = self.thread_id;
let window_number = state.auto_compact_window_number();
let window_number = self.context_window_number().await;
format!("{thread_id}:{window_number}")
}