Add hostname to the configurable TUI status line (#39795)

## What changed

- Add `hostname` as a selectable status-line item and show it in setup previews.
- Read the normalized operating-system hostname without triggering DNS resolution, and omit the item when no hostname is available.

## Testing

- Cover hostname normalization, status-line rendering, and setup and surface previews.

GitOrigin-RevId: c5e4e0ee1dba6e4bfdf942562a6b037835ff9e69
This commit is contained in:
Ian MacLeod authored and copyberry committed 2026-08-20 20:08:11 +00:00
1 parent bfb8986f7f
commit d9fd91edab
9 files changed
+116 -3

No files matched your search

@@ -85,6 +85,16 @@ fn cache_rate_limit_snapshot(chat: &mut ChatWidget) {
}));
}
#[tokio::test]
async fn status_surface_hostname_preview_uses_current_machine_hostname() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
assert_eq!(
status_preview_line(&mut chat, &[StatusLineItem::Hostname]),
codex_config::os_host_name().expect("machine hostname")
);
}
#[tokio::test]
async fn status_surface_preview_lines_live_only_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;