Add storage diagnostics to codex doctor (#38795)

## What changed

- Report available space for `CODEX_HOME` and the active worktree, warning below 5 GiB and failing below 1 GiB.
- On Windows, report whether the active Git worktree is on a trusted Dev Drive and provide remediation when it is not.
- Run attached doctor reports against the conversation workspace, including workspaces recovered from persisted thread metadata, while keeping the subprocess anchored in `CODEX_HOME` so deleted workspaces do not prevent it from starting.

## Testing

- Cover disk thresholds, measurement failures, missing paths, conversation workspace selection, command construction, Windows volume detection, and human-readable output.

GitOrigin-RevId: 0a99f9d278717e7d19936ffc504984b3a0958c25
This commit is contained in:
chess authored and copyberry committed 2026-08-15 18:47:25 +00:00
1 parent a95a6fe333
commit 6efcdad4c3
9 files changed
+669 -20

No files matched your search

+20 -2
View File
@@ -26,7 +26,7 @@ const GROUPS: &[OutputGroup] = &[
OutputGroup {
title: "Environment",
keys: &[
"system", "runtime", "install", "search", "git", "terminal", "title", "state",
"system", "disk", "runtime", "install", "search", "git", "terminal", "title", "state",
"threads",
],
},
@@ -1301,9 +1301,27 @@ Background Server
#[test]
fn render_human_report_snapshot_covers_environment_rows() {
let mut report = sample_report();
report.checks.push(DoctorCheck::new(
"system.disk",
"disk",
CheckStatus::Ok,
"sufficient free disk space (42.0 GiB)",
));
report.checks.push(
DoctorCheck::new(
"git.worktree.dev_drive",
"git",
CheckStatus::Warning,
"this worktree is not on a Windows Dev Drive",
)
.remediation(
"create a trusted Windows Dev Drive: https://learn.microsoft.com/en-us/windows/dev-drive/",
),
);
insta::assert_snapshot!(
"doctor_human_report_environment_rows",
render_human_report(&sample_report(), detailed_no_color_unicode_options())
render_human_report(&report, detailed_no_color_unicode_options())
);
}