re-implement session id in status (#2332)

Basically the same thing as https://github.com/openai/codex/pull/2297
This commit is contained in:
easong-openai
2025-08-14 19:14:46 -07:00
committed by GitHub
parent a075424437
commit d0b907d399
3 changed files with 19 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ use std::path::PathBuf;
use std::time::Duration;
use std::time::Instant;
use tracing::error;
use uuid::Uuid;
#[derive(Clone)]
pub(crate) struct CommandOutput {
@@ -483,7 +484,11 @@ pub(crate) fn new_diff_output(message: String) -> PlainHistoryCell {
PlainHistoryCell { lines }
}
pub(crate) fn new_status_output(config: &Config, usage: &TokenUsage) -> PlainHistoryCell {
pub(crate) fn new_status_output(
config: &Config,
usage: &TokenUsage,
session_id: &Option<Uuid>,
) -> PlainHistoryCell {
let mut lines: Vec<Line<'static>> = Vec::new();
lines.push(Line::from("/status".magenta()));
@@ -521,6 +526,13 @@ pub(crate) fn new_status_output(config: &Config, usage: &TokenUsage) -> PlainHis
sandbox_name.into(),
]));
if let Some(session_id) = session_id {
lines.push(Line::from(vec![
" • Session ID: ".into(),
session_id.to_string().into(),
]));
}
lines.push(Line::from(""));
// 👤 Account (only if ChatGPT tokens exist), shown under the first block