diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_copy_whole_status.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_copy_whole_status.snap index 1e0665b374..1da4b4a498 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_copy_whole_status.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__slash_copy_whole_status.snap @@ -4,17 +4,17 @@ expression: "whole_status.replace(&directory,\n\"[[workspace]]\").replace(crate: --- >_ OpenAI Codex (vVERSION) -Visit https://chatgpt.com/codex/settings/usage for up-to-date -information on rate limits and credits + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits - Model: GPT-5.5 (reasoning medium, summaries auto) - Model provider: openai - Directory: [[workspace]] - Permissions: Read Only (Ask for approval) - Agents.md: - Thread name: Clipboard example - Collaboration mode: Default - Session: 00000000-0000-0000-0000-000000000123 + Model: GPT-5.5 (reasoning medium, summaries auto) + Model provider: openai + Directory: [[workspace]] + Permissions: Read Only (Ask for approval) + Agents.md: + Thread name: Clipboard example + Collaboration mode: Default + Session: 00000000-0000-0000-0000-000000000123 - Token usage: 0 total (0 input + 0 output) - Limits: data not available yet + Token usage: 0 total (0 input + 0 output) + Limits: data not available yet diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage.snap index 9e649f0a8c..b6369418c7 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage.snap @@ -2,9 +2,8 @@ source: tui/src/chatwidget/tests/status_command_tests.rs expression: thread_usage --- -│ Thread usage: 50 credits · ~$1.82 │ -│ Models: GPT-5.4 80%, GPT-5 Mini 20% │ -│ Reasoning: Medium 20%, High 80% │ -│ Speed: Fast mode 80%, Standard 20% │ -│ Billed tokens: 120 input (25 cached) + 50 output │ -╰──────────────────────────────────────────────────────────────────────╯ + Thread usage: 50 credits · ~$1.82 + Models: GPT-5.4 80%, GPT-5 Mini 20% + Reasoning: Medium 20%, High 80% + Speed: Fast mode 80%, Standard 20% + Billed tokens: 120 input (25 cached) + 50 output diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage_without_usd.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage_without_usd.snap index 05f781c53d..45aaf2c3fd 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage_without_usd.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__status_command_estimated_thread_usage_without_usd.snap @@ -2,9 +2,8 @@ source: tui/src/chatwidget/tests/status_command_tests.rs expression: thread_usage --- -│ Thread usage: 50 credits │ -│ Models: GPT-5.4 100% │ -│ Reasoning: High 100% │ -│ Speed: Fast mode 100% │ -│ Billed tokens: 100 input (20 cached) + 40 output │ -╰──────────────────────────────────────────────────────────────────────╯ + Thread usage: 50 credits + Models: GPT-5.4 100% + Reasoning: High 100% + Speed: Fast mode 100% + Billed tokens: 100 input (20 cached) + 40 output diff --git a/codex-rs/tui/src/status/card.rs b/codex-rs/tui/src/status/card.rs index 45dce342f6..60300d079e 100644 --- a/codex-rs/tui/src/status/card.rs +++ b/codex-rs/tui/src/status/card.rs @@ -2,7 +2,6 @@ use crate::history_cell::CompositeHistoryCell; use crate::history_cell::HistoryCell; use crate::history_cell::PlainHistoryCell; use crate::history_cell::plain_lines; -use crate::history_cell::with_border_with_inner_width; use crate::legacy_core::config::Config; use crate::line_truncation::line_width; use crate::style::accent_color; @@ -33,7 +32,6 @@ use std::path::PathBuf; use super::account::StatusAccountDisplay; use super::format::FieldFormatter; use super::format::push_label; -use super::format::truncate_line_to_width; use super::helpers::compose_account_display; use super::helpers::compose_model_display; use super::helpers::format_directory_display; @@ -49,7 +47,6 @@ use super::rate_limits::render_status_limit_progress_bar; use super::remote_connection::RemoteConnectionStatus; use super::thread_usage::StatusThreadUsage; use crate::wrapping::RtOptions; -use crate::wrapping::adaptive_wrap_lines; use crate::wrapping::word_wrap_lines; use std::sync::Arc; use std::sync::RwLock; @@ -733,15 +730,11 @@ fn status_approval_label( impl StatusHistoryCell { fn content_lines(&self, width: u16) -> Vec> { - let mut lines: Vec> = Vec::new(); - let mut title = vec![FieldFormatter::INDENT.into()]; - title.extend(crate::history_cell::codex_title(CODEX_CLI_VERSION)); - lines.push(Line::from(title)); - - let available_inner_width = usize::from(width.saturating_sub(4)); - if available_inner_width == 0 { + let available_width = usize::from(width); + if available_width == 0 { return Vec::new(); } + let mut lines = Vec::new(); let account_value = self.account.as_ref().map(|account| match account { StatusAccountDisplay::ChatGpt { email, plan } => match (email, plan) { @@ -799,27 +792,8 @@ impl StatusHistoryCell { self.thread_usage.push_labels(&mut labels, &mut seen); let formatter = FieldFormatter::from_labels(labels.iter().map(String::as_str)); - let value_width = formatter.value_width(available_inner_width); + let value_width = formatter.value_width(available_width); - let note_first_line = Line::from(vec![ - Span::from("Visit ").fg(accent_color()), - CHATGPT_USAGE_URL.fg(accent_color()).underlined(), - Span::from(" for up-to-date").fg(accent_color()), - ]); - let note_second_line = Line::from(vec![ - Span::from("information on rate limits and credits").fg(accent_color()), - ]); - let note_lines = adaptive_wrap_lines( - [note_first_line, note_second_line], - RtOptions::new(available_inner_width), - ); - lines.push(Line::from(Vec::>::new())); - // The ChatGPT usage page only applies to providers backed by OpenAI auth; - // providers like Bedrock manage limits and billing elsewhere. - if self.show_chatgpt_usage_link { - lines.extend(note_lines); - lines.push(Line::from(Vec::>::new())); - } if let Some(remote_connection) = self.remote_connection.as_ref() { let value = if remote_connection.is_local_daemon { Line::from("Local background server") @@ -847,7 +821,7 @@ impl StatusHistoryCell { model_spans.push(Span::from(")").dim()); } - let directory_value = format_directory_display(&self.directory, Some(value_width)); + let directory_value = format_directory_display(&self.directory, /*max_width*/ None); lines.push(formatter.line("Model", model_spans)); if let Some(model_provider) = self.model_provider.as_ref() { @@ -886,32 +860,81 @@ impl StatusHistoryCell { lines.push(formatter.line("Context window", spans)); } - lines.extend(self.rate_limit_lines(&rate_limit_state, available_inner_width, &formatter)); + lines.extend(self.rate_limit_lines(&rate_limit_state, available_width, &formatter)); let thread_usage_lines = self.thread_usage.lines(&formatter, value_width); if !thread_usage_lines.is_empty() { lines.push(Line::from(Vec::>::new())); lines.extend(thread_usage_lines); } - lines + // Leave room for the two-column title mark even in a tiny terminal. + let indent = if available_width >= FieldFormatter::INDENT.len() + 2 { + FieldFormatter::INDENT + } else { + "" + }; + let mut title = vec![indent.into()]; + title.extend(crate::history_cell::codex_title(CODEX_CLI_VERSION)); + let mut rendered = word_wrap_lines( + [Line::from(title)], + RtOptions::new(available_width).subsequent_indent(indent.into()), + ); + rendered.push(Line::default()); + // Providers such as Bedrock manage limits and billing elsewhere. + if self.show_chatgpt_usage_link { + rendered.extend(word_wrap_lines( + [ + Line::from(vec![ + "Visit ".fg(accent_color()), + CHATGPT_USAGE_URL.fg(accent_color()).underlined(), + " for up-to-date".fg(accent_color()), + ]), + "information on rate limits and credits" + .fg(accent_color()) + .into(), + ], + RtOptions::new(available_width) + .initial_indent(indent.into()) + .subsequent_indent(indent.into()) + .word_separator(textwrap::WordSeparator::AsciiSpace) + .word_splitter(textwrap::WordSplitter::NoHyphenation), + )); + rendered.push(Line::default()); + } + // Keep every value, including long paths and IDs, aligned beneath its first line. + // At widths too small for the label column, use the outer indent instead. + let continuation = if value_width > 0 { + formatter.continuation(Vec::new()) + } else { + indent.into() + }; + let options = RtOptions::new(available_width) + .subsequent_indent(continuation) + .word_splitter(textwrap::WordSplitter::NoHyphenation); + rendered.extend(lines.into_iter().flat_map(|line| { + let wrapped = word_wrap_lines([line.clone()], options.clone()); + if wrapped + .iter() + .any(|line| line_width(line) > available_width) + { + // A wide grapheme may not fit after the continuation indent. + word_wrap_lines( + [line], + RtOptions::new(available_width) + .word_splitter(textwrap::WordSplitter::NoHyphenation), + ) + } else { + wrapped + } + })); + + rendered } } impl HistoryCell for Arc { fn display_lines(&self, width: u16) -> Vec> { - let available_inner_width = usize::from(width.saturating_sub(4)); - if available_inner_width == 0 { - return Vec::new(); - } - let lines = self.content_lines(width); - let content_width = lines.iter().map(line_width).max().unwrap_or(0); - let inner_width = content_width.min(available_inner_width); - let truncated_lines: Vec> = lines - .into_iter() - .map(|line| truncate_line_to_width(line, inner_width)) - .collect(); - - with_border_with_inner_width(truncated_lines, inner_width) + self.content_lines(width) } fn raw_lines(&self) -> Vec> { diff --git a/codex-rs/tui/src/status/format.rs b/codex-rs/tui/src/status/format.rs index e7ff9fd138..f11c75df34 100644 --- a/codex-rs/tui/src/status/format.rs +++ b/codex-rs/tui/src/status/format.rs @@ -1,7 +1,6 @@ use ratatui::prelude::*; use ratatui::style::Stylize; use std::collections::BTreeSet; -use unicode_segmentation::UnicodeSegmentation; use crate::width::display_width; @@ -14,7 +13,7 @@ pub(crate) struct FieldFormatter { } impl FieldFormatter { - pub(crate) const INDENT: &'static str = " "; + pub(crate) const INDENT: &'static str = " "; pub(crate) fn from_labels(labels: impl IntoIterator) -> Self where @@ -26,7 +25,7 @@ impl FieldFormatter { .max() .unwrap_or(0); let indent_width = display_width(Self::INDENT); - let value_offset = indent_width + label_width + 1 + 3; + let value_offset = indent_width + label_width + 1 + 2; Self { indent: Self::INDENT, @@ -74,7 +73,7 @@ impl FieldFormatter { buf.push(':'); let label_width = display_width(label); - let padding = 3 + self.label_width.saturating_sub(label_width); + let padding = 2 + self.label_width.saturating_sub(label_width); for _ in 0..padding { buf.push(' '); } @@ -92,51 +91,3 @@ pub(crate) fn push_label(labels: &mut Vec, seen: &mut BTreeSet, seen.insert(owned.clone()); labels.push(owned); } - -pub(crate) fn truncate_line_to_width(line: Line<'static>, max_width: usize) -> Line<'static> { - if max_width == 0 { - return Line::from(Vec::>::new()); - } - - let mut used = 0usize; - let mut spans_out: Vec> = Vec::new(); - - for span in line.spans { - let text = span.content.into_owned(); - let style = span.style; - let span_width = display_width(text.as_str()); - - if span_width == 0 { - spans_out.push(Span::styled(text, style)); - continue; - } - - if used >= max_width { - break; - } - - if used + span_width <= max_width { - used += span_width; - spans_out.push(Span::styled(text, style)); - continue; - } - - let mut truncated = String::new(); - for grapheme in text.graphemes(/*is_extended*/ true) { - let grapheme_width = display_width(grapheme); - if used + grapheme_width > max_width { - break; - } - truncated.push_str(grapheme); - used += grapheme_width; - } - - if !truncated.is_empty() { - spans_out.push(Span::styled(truncated, style)); - } - - break; - } - - Line::from(spans_out) -} diff --git a/codex-rs/tui/src/status/mod.rs b/codex-rs/tui/src/status/mod.rs index 43959526fa..8f46cfc0dd 100644 --- a/codex-rs/tui/src/status/mod.rs +++ b/codex-rs/tui/src/status/mod.rs @@ -2,7 +2,7 @@ //! //! This module turns protocol-level snapshots into stable display structures used by `/status` //! output and footer/status-line helpers, while keeping rendering concerns out of transport-facing -//! code. +//! code. The status summary is borderless and wraps values without truncating paths or IDs. //! //! `rate_limits` is the main integration point for status-line usage-limit items: it converts raw //! window snapshots into local-time labels and classifies data as available, stale, or missing. diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_not_required.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_not_required.snap index 701080e695..a00c3ae09e 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_not_required.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_not_required.snap @@ -4,15 +4,13 @@ expression: rendered --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Model: gpt-5.6-sol (reasoning none, summaries auto) │ -│ Model provider: server-ollama │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 0 total (0 input + 0 output) │ -│ Limits: data not available yet │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Model: gpt-5.6-sol (reasoning none, summaries auto) + Model provider: server-ollama + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 0 total (0 input + 0 output) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_required.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_required.snap index d31fdf2a03..6c856d50a4 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_required.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_server_auth_required.snap @@ -4,18 +4,16 @@ expression: rendered --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.6-sol (reasoning none, summaries auto) │ -│ Model provider: server-openai │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 0 total (0 input + 0 output) │ -│ Limits: data not available yet │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.6-sol (reasoning none, summaries auto) + Model provider: server-openai + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 0 total (0 input + 0 output) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_cached_limits_hide_credits_without_flag.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_cached_limits_hide_credits_without_flag.snap index c7d89b17aa..4f55f6a763 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_cached_limits_hide_credits_without_flag.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_cached_limits_hide_credits_without_flag.snap @@ -4,20 +4,18 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 1.05K total (700 input + 350 output) │ -│ Context window: 100% left (1.45K used / 272K) │ -│ 5h limit: [████████░░░░░░░░░░░░] 40% left (resets 11:32) │ -│ Weekly limit: [█████████████░░░░░░░] 65% left (resets 11:52) │ -│ Warning: limits may be stale - start new turn to refresh. │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 1.05K total (700 input + 350 output) + Context window: 100% left (1.45K used / 272K) + 5h limit: [████████░░░░░░░░░░░░] 40% left (resets 11:32) + Weekly limit: [█████████████░░░░░░░] 65% left (resets 11:52) + Warning: limits may be stale - start new turn to refresh. diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_credits_and_limits.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_credits_and_limits.snap index c1636b6c15..9d8fba759f 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_credits_and_limits.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_credits_and_limits.snap @@ -4,20 +4,18 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 2K total (1.4K input + 600 output) │ -│ Context window: 100% left (2.2K used / 272K) │ -│ 5h limit: [███████████░░░░░░░░░] 55% left (resets 09:25) │ -│ Weekly limit: [██████████████░░░░░░] 70% left (resets 09:55) │ -│ Credits: Available │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 2K total (1.4K input + 600 output) + Context window: 100% left (2.2K used / 272K) + 5h limit: [███████████░░░░░░░░░] 55% left (resets 09:25) + Weekly limit: [██████████████░░░░░░] 70% left (resets 09:55) + Credits: Available diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_enterprise_monthly_credit_limit.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_enterprise_monthly_credit_limit.snap index 765ad8d3a7..be84d82de5 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_enterprise_monthly_credit_limit.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_enterprise_monthly_credit_limit.snap @@ -4,19 +4,17 @@ expression: sanitized --- /status -╭───────────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 1.2K total (800 input + 400 output) │ -│ Context window: 100% left (1.2K used / 272K) │ -│ Monthly credit limit: [██████████████░░░░░░] 68% left (resets 07:08 on 7 May) │ -│ 8,000 of 25,000 credits used │ -╰───────────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 1.2K total (800 input + 400 output) + Context window: 100% left (1.2K used / 272K) + Monthly credit limit: [██████████████░░░░░░] 68% left (resets 07:08 on 7 May) + 8,000 of 25,000 credits used diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_forked_from.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_forked_from.snap index 152575179e..a32113539f 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_forked_from.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_forked_from.snap @@ -4,20 +4,18 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ Session: 0f0f3c13-6cf9-4aa4-8b80-7d49c2f1be2e │ -│ Forked from: e9f18a88-8081-4e51-9d4e-8af5cde2d8dd │ -│ │ -│ Token usage: 1.2K total (800 input + 400 output) │ -│ Context window: 100% left (1.2K used / 272K) │ -│ Limits: data not available yet │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + Session: 0f0f3c13-6cf9-4aa4-8b80-7d49c2f1be2e + Forked from: e9f18a88-8081-4e51-9d4e-8af5cde2d8dd + + Token usage: 1.2K total (800 input + 400 output) + Context window: 100% left (1.2K used / 272K) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_monthly_limit.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_monthly_limit.snap index 7a4f58a823..f2cc2fbe1c 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_monthly_limit.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_monthly_limit.snap @@ -4,18 +4,16 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 1.2K total (800 input + 400 output) │ -│ Context window: 100% left (1.2K used / 272K) │ -│ Monthly limit: [██████████████████░░] 88% left (resets 07:08 on 7 May) │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 1.2K total (800 input + 400 output) + Context window: 100% left (1.2K used / 272K) + Monthly limit: [██████████████████░░] 88% left (resets 07:08 on 7 May) diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_reasoning_details.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_reasoning_details.snap index ce965287d5..06866b52e7 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_reasoning_details.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_includes_reasoning_details.snap @@ -4,19 +4,17 @@ expression: sanitized --- /status -╭───────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning high, summaries detailed) │ -│ Directory: [[workspace]] │ -│ Permissions: Workspace (Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 1.9K total (1K input + 900 output) │ -│ Context window: 100% left (2.25K used / 272K) │ -│ 5h limit: [██████░░░░░░░░░░░░░░] 28% left (resets 3:14 AM) │ -│ Weekly limit: [███████████░░░░░░░░░] 55% left (resets 3:24 AM) │ -╰───────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning high, summaries detailed) + Directory: [[workspace]] + Permissions: Workspace (Ask for approval) + Agents.md: + + Token usage: 1.9K total (1K input + 900 output) + Context window: 100% left (2.25K used / 272K) + 5h limit: [██████░░░░░░░░░░░░░░] 28% left (resets 3:14 AM) + Weekly limit: [███████████░░░░░░░░░] 55% left (resets 3:24 AM) diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_local_background_server.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_local_background_server.snap index 7e65d321ce..163ee982b5 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_local_background_server.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_local_background_server.snap @@ -4,20 +4,18 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Server: Local background server │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning medium, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 750 total (500 input + 250 output) │ -│ Context window: 100% left (750 used / 272K) │ -│ Limits: data not available yet │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Server: Local background server + + Model: gpt-5.1-codex-max (reasoning medium, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 750 total (500 input + 250 output) + Context window: 100% left (750 used / 272K) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_active_user_defined_profile.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_active_user_defined_profile.snap index 4604b26f7e..01134f2221 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_active_user_defined_profile.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_active_user_defined_profile.snap @@ -4,18 +4,16 @@ expression: sanitized --- /status -╭───────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Profile locked (read-only, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 0 total (0 input + 0 output) │ -│ Context window: 100% left (0 used / 272K) │ -│ Limits: data not available yet │ -╰───────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Profile locked (read-only, Ask for approval) + Agents.md: + + Token usage: 0 total (0 input + 0 output) + Context window: 100% left (0 used / 272K) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_auto_review_permissions.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_auto_review_permissions.snap index c739d55075..7173c997ec 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_auto_review_permissions.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_auto_review_permissions.snap @@ -4,18 +4,16 @@ expression: sanitized --- /status -╭───────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Workspace (Approve for me) │ -│ Agents.md: │ -│ │ -│ Token usage: 0 total (0 input + 0 output) │ -│ Context window: 100% left (0 used / 272K) │ -│ Limits: data not available yet │ -╰───────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Workspace (Approve for me) + Agents.md: + + Token usage: 0 total (0 input + 0 output) + Context window: 100% left (0 used / 272K) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_chatgpt_plan_without_email.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_chatgpt_plan_without_email.snap index 0aba51f99a..e3b9bae320 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_chatgpt_plan_without_email.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_chatgpt_plan_without_email.snap @@ -4,17 +4,15 @@ expression: sanitized --- /status -╭──────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ Account: Enterprise (Automation) │ -│ │ -│ Limits: data not available yet │ -╰──────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + Account: Enterprise (Automation) + + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_missing_limits_message.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_missing_limits_message.snap index 533be27976..9a948fe130 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_missing_limits_message.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_missing_limits_message.snap @@ -4,18 +4,16 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 750 total (500 input + 250 output) │ -│ Context window: 100% left (750 used / 272K) │ -│ Limits: data not available yet │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 750 total (500 input + 250 output) + Context window: 100% left (750 used / 272K) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_refreshing_limits_notice.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_refreshing_limits_notice.snap index 631982bcf9..49ac38b2f5 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_refreshing_limits_notice.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_refreshing_limits_notice.snap @@ -4,19 +4,17 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 750 total (500 input + 250 output) │ -│ Context window: 100% left (750 used / 272K) │ -│ 5h limit: [███████████░░░░░░░░░] 55% left (resets 08:24) │ -│ Weekly limit: [██████████████░░░░░░] 70% left (resets 08:54) │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 750 total (500 input + 250 output) + Context window: 100% left (750 used / 272K) + 5h limit: [███████████░░░░░░░░░] 55% left (resets 08:24) + Weekly limit: [██████████████░░░░░░] 70% left (resets 08:54) diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_stale_limits_message.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_stale_limits_message.snap index 8facd56275..247465654a 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_stale_limits_message.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_stale_limits_message.snap @@ -4,20 +4,18 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 1.9K total (1K input + 900 output) │ -│ Context window: 100% left (2.25K used / 272K) │ -│ 5h limit: [██████░░░░░░░░░░░░░░] 28% left (resets 03:14) │ -│ Weekly limit: [████████████░░░░░░░░] 60% left (resets 03:34) │ -│ Warning: limits may be stale - start new turn to refresh. │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 1.9K total (1K input + 900 output) + Context window: 100% left (2.25K used / 272K) + 5h limit: [██████░░░░░░░░░░░░░░] 28% left (resets 03:14) + Weekly limit: [████████████░░░░░░░░] 60% left (resets 03:34) + Warning: limits may be stale - start new turn to refresh. diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_unavailable_limits_message.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_unavailable_limits_message.snap index d46a483e4b..7d4340538c 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_unavailable_limits_message.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_shows_unavailable_limits_message.snap @@ -4,18 +4,16 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 750 total (500 input + 250 output) │ -│ Context window: 100% left (750 used / 272K) │ -│ Limits: not available for this account │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 750 total (500 input + 250 output) + Context window: 100% left (750 used / 272K) + Limits: not available for this account diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_treats_refreshing_empty_limits_as_unavailable.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_treats_refreshing_empty_limits_as_unavailable.snap index d46a483e4b..7d4340538c 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_treats_refreshing_empty_limits_as_unavailable.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_treats_refreshing_empty_limits_as_unavailable.snap @@ -4,18 +4,16 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 750 total (500 input + 250 output) │ -│ Context window: 100% left (750 used / 272K) │ -│ Limits: not available for this account │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 750 total (500 input + 250 output) + Context window: 100% left (750 used / 272K) + Limits: not available for this account diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_halfwidth_kana_in_narrow_terminal.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_halfwidth_kana_in_narrow_terminal.snap index 17442d7076..23496e49f8 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_halfwidth_kana_in_narrow_terminal.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_halfwidth_kana_in_narrow_terminal.snap @@ -4,21 +4,30 @@ expression: sanitized --- /status -╭────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit │ -│ https://chatgpt.com/codex/settings/usa │ -│ for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: ガパガパガパガ │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspa │ -│ Agents.md: │ -│ Account: ガパガパガパ@ex │ -│ Thread name: ガパガパガパガ │ -│ Collaboration mode: ガパ collaborat │ -│ │ -│ Limits: data not availa │ -╰────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit + https://chatgpt.com/codex/settings/usage + for up-to-date + information on rate limits and credits + + Model: ガパガパガパガ + パ-model (reasoning + none, summaries + auto) + Directory: [[workspace]] + Permissions: Custom (workspace + with network + access, Ask for + approval) + Agents.md: + Account: ガパガパガパ + @example.com (ガパ + plan) + Thread name: ガパガパガパガパ + thread + Collaboration mode: ガパ collaboration + mode + + Limits: data not available + yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap index 6b28b53b62..ac59138592 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_truncates_in_narrow_terminal.snap @@ -4,18 +4,18 @@ expression: sanitized --- /status -╭────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning high, summaries de │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for │ -│ Agents.md: │ -│ │ -│ Token usage: 1.9K total (1K input + 900 output) │ -│ Context window: 100% left (2.25K used / 272K) │ -│ 5h limit: [██████░░░░░░░░░░░░░░] 28% left (resets 03:14) │ -╰────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning high, summaries + detailed) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for + approval) + Agents.md: + + Token usage: 1.9K total (1K input + 900 output) + Context window: 100% left (2.25K used / 272K) + 5h limit: [██████░░░░░░░░░░░░░░] 28% left (resets 03:14) diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_default_reasoning_when_config_empty.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_default_reasoning_when_config_empty.snap index 5eefeb85ea..03e80108e2 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_default_reasoning_when_config_empty.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_default_reasoning_when_config_empty.snap @@ -4,21 +4,19 @@ expression: sanitized --- /status -╭─────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Server: unix:///tmp/codex-home/app-server-control/app-server- │ -│ control.sock (v0.133.0) │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning medium, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 750 total (500 input + 250 output) │ -│ Context window: 100% left (750 used / 272K) │ -│ Limits: data not available yet │ -╰─────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Server: unix:///tmp/codex-home/app-server-control/app-server- + control.sock (v0.133.0) + + Model: gpt-5.1-codex-max (reasoning medium, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 750 total (500 input + 250 output) + Context window: 100% left (750 used / 272K) + Limits: data not available yet diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_generic_limit_labels_for_unsupported_windows.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_generic_limit_labels_for_unsupported_windows.snap index 6b6fad683b..a1430ac31d 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_generic_limit_labels_for_unsupported_windows.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_uses_generic_limit_labels_for_unsupported_windows.snap @@ -4,21 +4,20 @@ expression: sanitized --- /status -╭──────────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for app │ -│ Agents.md: │ -│ │ -│ Token usage: 1.2K total (800 input + 400 output) │ -│ Context window: 100% left (1.2K used / 272K) │ -│ Usage limit: [█████████████░░░░░░░] 65% left │ -│ (resets 07:08 on 7 May) │ -│ Secondary usage limit: [██████████░░░░░░░░░░] 50% left │ -│ (resets 07:08 on 8 May) │ -╰──────────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for + approval) + Agents.md: + + Token usage: 1.2K total (800 input + 400 output) + Context window: 100% left (1.2K used / 272K) + Usage limit: [█████████████░░░░░░░] 65% left + (resets 07:08 on 7 May) + Secondary usage limit: [██████████░░░░░░░░░░] 50% left + (resets 07:08 on 8 May) diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_wraps_enterprise_monthly_credit_details_in_narrow_terminal.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_wraps_enterprise_monthly_credit_details_in_narrow_terminal.snap index cf6fa2c2ec..950a3d4d38 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_wraps_enterprise_monthly_credit_details_in_narrow_terminal.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__status_snapshot_wraps_enterprise_monthly_credit_details_in_narrow_terminal.snap @@ -4,24 +4,28 @@ expression: sanitized --- /status -╭────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit │ -│ https://chatgpt.com/codex/settings/usage │ -│ for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace │ -│ Agents.md: │ -│ │ -│ Token usage: 1.2K total (800 │ -│ Context window: 100% left (1.2K u │ -│ Monthly credit limit: 68% left │ -│ (resets 07:08 on │ -│ 7 May) │ -│ 8,000 of 25,000 │ -│ credits used │ -╰────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit + https://chatgpt.com/codex/settings/usage for + up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max + (reasoning none, + summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace + with network access, + Ask for approval) + Agents.md: + + Token usage: 1.2K total (800 + input + 400 output) + Context window: 100% left (1.2K + used / 272K) + Monthly credit limit: 68% left + (resets 07:08 on + 7 May) + 8,000 of 25,000 + credits used diff --git a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__transcript_overlay_status_rate_limit_refresh.snap b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__transcript_overlay_status_rate_limit_refresh.snap index 0fb60fae57..f7871d8a38 100644 --- a/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__transcript_overlay_status_rate_limit_refresh.snap +++ b/codex-rs/tui/src/status/snapshots/codex_tui__status__tests__transcript_overlay_status_rate_limit_refresh.snap @@ -1,26 +1,25 @@ --- source: tui/src/status/tests.rs -assertion_line: 1825 expression: "format!(\"before:\\n{before}\\n\\nafter:\\n{after}\")" --- before: / T R A N S C R I P T / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /status -╭──────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 0 total (0 input + 0 output) │ -│ Limits: refresh requested; run /status again shortly. │ -╰──────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 0 total (0 input + 0 output) + Limits: refresh requested; run /status again shortly. + + @@ -39,22 +38,20 @@ after: / T R A N S C R I P T / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /status -╭───────────────────────────────────────────────────────────────────────────╮ -│ >_ OpenAI Codex (v0.0.0) │ -│ │ -│ Visit https://chatgpt.com/codex/settings/usage for up-to-date │ -│ information on rate limits and credits │ -│ │ -│ Model: gpt-5.1-codex-max (reasoning none, summaries auto) │ -│ Directory: [[workspace]] │ -│ Permissions: Custom (workspace with network access, Ask for approval) │ -│ Agents.md: │ -│ │ -│ Token usage: 0 total (0 input + 0 output) │ -│ spark limit: │ -│ 5h limit: [███████████░░░░░░░░░] 55% left (resets soon) │ -│ Weekly limit: [██████████████░░░░░░] 70% left (resets later) │ -╰───────────────────────────────────────────────────────────────────────────╯ + >_ OpenAI Codex (v0.0.0) + + Visit https://chatgpt.com/codex/settings/usage for up-to-date + information on rate limits and credits + + Model: gpt-5.1-codex-max (reasoning none, summaries auto) + Directory: [[workspace]] + Permissions: Custom (workspace with network access, Ask for approval) + Agents.md: + + Token usage: 0 total (0 input + 0 output) + spark limit: + 5h limit: [███████████░░░░░░░░░] 55% left (resets soon) + Weekly limit: [██████████████░░░░░░] 70% left (resets later) next message @@ -62,6 +59,8 @@ next message + + Ctrl+Space select ↑/↓ to scroll · pgup/pgdn to page · home/end to jump q close · f3 find · esc browse prompts diff --git a/codex-rs/tui/src/status/tests.rs b/codex-rs/tui/src/status/tests.rs index bb65053072..f501402ef3 100644 --- a/codex-rs/tui/src/status/tests.rs +++ b/codex-rs/tui/src/status/tests.rs @@ -59,7 +59,6 @@ use pretty_assertions::assert_eq; use ratatui::prelude::*; use std::sync::Arc; use tempfile::TempDir; -use unicode_width::UnicodeWidthStr; #[test] fn stale_monthly_limit_marks_fresh_rolling_snapshot_stale() { @@ -147,6 +146,7 @@ async fn test_config(temp_home: &TempDir) -> Config { /*network_enabled*/ true, )) .expect("set permission profile"); + set_workspace_cwd(&mut config, test_path_buf("/workspace/tests").abs()); config } @@ -186,30 +186,12 @@ fn render_lines(lines: &[Line<'static>]) -> Vec { } fn sanitize_directory(lines: Vec) -> Vec { - let frame_width = lines - .iter() - .find(|line| line.starts_with('╭')) - .map(|line| UnicodeWidthStr::width(line.as_str())); lines .into_iter() .map(|line| { - if let (Some(frame_width), Some(dir_pos), Some(pipe_idx)) = - (frame_width, line.find("Directory: "), line.rfind('│')) - { - let prefix = &line[..dir_pos + "Directory: ".len()]; - let suffix = &line[pipe_idx..]; - let replacement = "[[workspace]]"; - let content_width = frame_width.saturating_sub( - UnicodeWidthStr::width(prefix) + UnicodeWidthStr::width(suffix), - ); - let mut rebuilt = prefix.to_string(); - rebuilt.push_str(replacement); - let replacement_width = UnicodeWidthStr::width(replacement); - if content_width > replacement_width { - rebuilt.push_str(&" ".repeat(content_width - replacement_width)); - } - rebuilt.push_str(suffix); - rebuilt + if let Some((prefix, value)) = line.split_once("Directory:") { + let padding = &value[..value.len() - value.trim_start().len()]; + format!("{prefix}Directory:{padding}[[workspace]]") } else { line } @@ -846,16 +828,18 @@ async fn status_uses_server_provider_id_and_auth_requirement() { sanitize_directory(render_lines(&composite.display_lines(/*width*/ 120))).join("\n"); assert_snapshot!("status_server_auth_required", rendered); - let wide_destinations: Vec = composite - .display_hyperlink_lines(/*width*/ 120) - .into_iter() - .flat_map(|line| line.hyperlinks.into_iter()) - .map(|link| link.destination) - .collect(); - assert_eq!( - wide_destinations, - vec!["https://chatgpt.com/codex/settings/usage"] - ); + for width in [42, 120] { + let destinations: Vec = composite + .display_hyperlink_lines(width) + .into_iter() + .flat_map(|line| line.hyperlinks.into_iter()) + .map(|link| link.destination) + .collect(); + assert_eq!( + destinations, + vec!["https://chatgpt.com/codex/settings/usage"] + ); + } let narrow_destinations: Vec = composite .display_hyperlink_lines(/*width*/ 24) @@ -1495,7 +1479,61 @@ async fn status_card_token_usage_excludes_cached_tokens() { } #[tokio::test] -async fn status_snapshot_truncates_in_narrow_terminal() { +async fn status_wraps_long_paths_and_session_ids_without_losing_text() { + let temp_home = TempDir::new().expect("temp home"); + let mut config = test_config(&temp_home).await; + let directory = test_path_buf("/workspace/projects/界界/ガ゙/a-very-long-directory-name/codex"); + set_workspace_cwd(&mut config, directory.abs()); + let session = + ThreadId::from_string("00000000-0000-0000-0000-000000000123").expect("session id"); + let usage = TokenUsage::default(); + let (status, handle) = new_status_output_with_rate_limits_handle( + &config, + /*requires_openai_auth*/ true, + /*model_provider_id*/ None, + /*remote_connection*/ None, + /*account_display*/ None, + /*token_info*/ None, + &usage, + &Some(session), + Some("A thread with a long descriptive name".to_string()), + /*forked_from*/ None, + /*rate_limits*/ &[], + /*_plan_type*/ None, + Local::now(), + "gpt-5.5", + /*collaboration_mode*/ None, + /*reasoning_effort_override*/ None, + "".to_string(), + /*refreshing_rate_limits*/ false, + ); + let directory = directory.to_string_lossy(); + for width in [7, 12, 17, 18, 24, 25, 40, 80] { + let lines = status.display_lines(width); + assert!( + lines.iter().all(|line| line.width() <= usize::from(width)), + "overwide row at width {width}: {:?}", + render_lines(&lines) + ); + let joined = lines + .iter() + .map(|line| line.to_string().trim().to_string()) + .collect::(); + assert!( + joined.contains(directory.as_ref()), + "path lost at width {width}: {joined}" + ); + assert!( + joined.contains(&session.to_string()), + "session lost at width {width}: {joined}" + ); + } + assert!(handle.copy_text().contains(directory.as_ref())); + assert!(handle.copy_text().contains(&session.to_string())); +} + +#[tokio::test] +async fn status_snapshot_wraps_in_narrow_terminal() { let temp_home = TempDir::new().expect("temp home"); let mut config = test_config(&temp_home).await; config.model = Some("gpt-5.1-codex-max".to_string()); @@ -1560,11 +1598,11 @@ async fn status_snapshot_truncates_in_narrow_terminal() { } let sanitized = sanitize_directory(rendered_lines).join("\n"); - assert_snapshot!(sanitized); + assert_snapshot!("status_snapshot_truncates_in_narrow_terminal", sanitized); } #[tokio::test] -async fn status_snapshot_truncates_halfwidth_kana_in_narrow_terminal() { +async fn status_snapshot_wraps_halfwidth_kana_in_narrow_terminal() { let temp_home = TempDir::new().expect("temp home"); let mut config = test_config(&temp_home).await; set_workspace_cwd(&mut config, test_path_buf("/workspace/tests").abs()); @@ -1596,7 +1634,10 @@ async fn status_snapshot_truncates_halfwidth_kana_in_narrow_terminal() { let rendered_lines = render_lines(&composite.display_lines(/*width*/ 42)); let sanitized = sanitize_directory(rendered_lines).join("\n"); - assert_snapshot!(sanitized); + assert_snapshot!( + "status_snapshot_truncates_halfwidth_kana_in_narrow_terminal", + sanitized + ); } #[tokio::test] diff --git a/codex-rs/tui/src/tui/history_tail.rs b/codex-rs/tui/src/tui/history_tail.rs index 46cebd7f78..f9a2c9b862 100644 --- a/codex-rs/tui/src/tui/history_tail.rs +++ b/codex-rs/tui/src/tui/history_tail.rs @@ -1,4 +1,5 @@ //! Update visible terminal-history tails without discarding terminal scrollback. +//! When the existing tail is an unchanged prefix, append only the new rows. use super::Tui; use crate::custom_terminal::Terminal as CustomTerminal; @@ -66,7 +67,7 @@ where let Ok(previous_rows) = u16::try_from(previous_rows) else { return Ok(false); }; - if previous_rows == 0 || previous_rows > viewport.top() { + if previous_rows > viewport.top() { return Ok(false); } diff --git a/codex-rs/tui/src/tui/history_tail_tests.rs b/codex-rs/tui/src/tui/history_tail_tests.rs index a02621ca2d..9c1c3b07cc 100644 --- a/codex-rs/tui/src/tui/history_tail_tests.rs +++ b/codex-rs/tui/src/tui/history_tail_tests.rs @@ -105,6 +105,38 @@ fn inaccessible_history_tail_is_preserved_for_non_destructive_append() { assert_eq!(terminal.backend().vt100().screen().contents(), before); } +#[test] +fn appending_to_unchanged_history_tail_preserves_existing_rows() { + let width = 52; + let height = 8; + let backend = VT100Backend::new(width, height); + let mut terminal = Terminal::with_options(backend).expect("terminal"); + terminal.set_viewport_area(Rect::new( + /*x*/ 0, /*y*/ 0, width, /*height*/ 2, + )); + insert_history_lines( + &mut terminal, + vec![Line::from("/status"), Line::from("Account: business")], + ) + .expect("insert initial status card"); + let replacement = plain_hyperlink_lines(vec![Line::from("Thread usage: 50 credits")]); + + assert!( + replace_visible_terminal_history_tail( + &mut terminal, + /*previous_lines*/ &[], + &replacement, + InsertHistoryMode::Standard, + HistoryLineWrapPolicy::PreWrap, + ) + .expect("append late billing details") + ); + assert_eq!( + terminal.backend().vt100().screen().contents(), + "/status\nAccount: business\nThread usage: 50 credits" + ); +} + #[test] fn replacing_soft_wrapped_history_counts_physical_terminal_rows() { let width = 12;