Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Report the configured TUI mode in `codex doctor` (#50200)

Eric Trauta75987455a28
diff --git a/codex-rs/cli/src/doctor.rs b/codex-rs/cli/src/doctor.rs
index bcb53df6a7..b9f26e9d86 100644
--- a/codex-rs/cli/src/doctor.rs
+++ b/codex-rs/cli/src/doctor.rs
@@ -1113,6 +1113,14 @@ fn config_check(config: &Config) -> DoctorCheck {
config.model.as_deref().unwrap_or("<default>")
));
details.push(format!("model provider: {}", config.model_provider_id));
+ details.push(format!(
+ "configured TUI mode: {}",
+ if config.tui_fullscreen_transcript {
+ "fullscreen"
+ } else {
+ "scrollback"
+ }
+ ));
details.push(format!("log dir: {}", config.log_dir.display()));
details.push(format!(
"sqlite home: {}",
diff --git a/codex-rs/cli/src/doctor/output.rs b/codex-rs/cli/src/doctor/output.rs
index a6142503de..3ce3fd1b28 100644
--- a/codex-rs/cli/src/doctor/output.rs
+++ b/codex-rs/cli/src/doctor/output.rs
@@ -1415,6 +1415,10 @@ Background Server
#[test]
fn render_human_report_snapshot_covers_environment_rows() {
let mut report = sample_report();
+ report.checks.push(
+ DoctorCheck::new("config.load", "config", CheckStatus::Ok, "config loaded")
+ .detail("configured TUI mode: fullscreen"),
+ );
report.checks.push(DoctorCheck::new(
"system.disk",
"disk",
diff --git a/codex-rs/cli/src/doctor/snapshots/codex__doctor__output__tests__doctor_human_report_environment_rows.snap b/codex-rs/cli/src/doctor/snapshots/codex__doctor__output__tests__doctor_human_report_environment_rows.snap
index 7aec6928df..90a4d4bfc3 100644
--- a/codex-rs/cli/src/doctor/snapshots/codex__doctor__output__tests__doctor_human_report_environment_rows.snap
+++ b/codex-rs/cli/src/doctor/snapshots/codex__doctor__output__tests__doctor_human_report_environment_rows.snap
@@ -45,6 +45,9 @@ Environment
✓ state state paths inspectable
Configuration
+ ✓ config loaded
+ feature flags 0 enabled · 0 overridden
+ configured TUI mode fullscreen
✗ auth token expired — Run `codex login`.
OPENAI_API_KEY present
@@ -69,7 +72,7 @@ Background Server
✓ app-server background server is not running
─────────────────────────────────────────────────────────────
-15 ok · 5 notes · 3 warn · 1 fail failed
+16 ok · 5 notes · 3 warn · 1 fail failed
--summary compact output --all expand truncated lists
--json redacted report
diff --git a/codex-rs/cli/tests/doctor_path_safety.rs b/codex-rs/cli/tests/doctor_path_safety.rs
index b560486bfc..bbc4f9f7bb 100644
--- a/codex-rs/cli/tests/doctor_path_safety.rs
+++ b/codex-rs/cli/tests/doctor_path_safety.rs
@@ -414,6 +414,24 @@ fn doctor_reports_only_safe_config_error_metadata() -> Result<()> {
Ok(())
}
+#[test]
+fn doctor_reports_configured_tui_mode() -> Result<()> {
+ let fixture = Fixture::new()?;
+ for (setting, expected) in [("true", "fullscreen"), ("false", "scrollback")] {
+ let output = fixture
+ .command()?
+ .args(["-c", &format!("tui.fullscreen_transcript={setting}")])
+ .args(["doctor", "--json"])
+ .output()?;
+ let report: Value = serde_json::from_slice(&output.stdout)?;
+ assert_eq!(
+ report["checks"]["config.load"]["details"]["configured TUI mode"],
+ expected
+ );
+ }
+ Ok(())
+}
+
#[test]
fn doctor_reports_configured_filesystem_paths() -> Result<()> {
let fixture = Fixture::new()?;