mirror of
https://github.com/openai/codex.git
synced 2026-11-08 16:38:30 +00:00
Implements #18162 This updates the TUI terminal title to show an explicit action-required state when Codex is blocked on user approval or input. The terminal title now uses the activity title item to cover both active work and blocked-on-user states, while still accepting the legacy spinner config value. Changes - Rename the terminal title item from `spinner` to `activity` while preserving legacy config compatibility - Show `[ ! ] Action Required `while approval or input overlays are active, with a blinking `[ . ]` alternate state - Suppress the normal working spinner while Codex is blocked on user action - Add targeted coverage for action-required title behavior and legacy title-item parsing Testing - Trigger an approval or input modal and confirm the tab title alternates between `[ ! ] Action Required` and `[ . ] Action Required` - Disable the activity title item and confirm the action-required title does not appear - Resolve the prompt and confirm the title returns to the normal spinning/idel state https://github.com/user-attachments/assets/e9ecc530-a6be-4fd7-b9a6-d550a790eb2c
26 lines
683 B
Rust
26 lines
683 B
Rust
use super::TerminalTitleItem;
|
|
|
|
pub(crate) const ACTION_REQUIRED_PREVIEW_PREFIX: &str = "[ ! ] Action Required";
|
|
|
|
pub(crate) fn build_action_required_title_text<I, F>(
|
|
prefix: &str,
|
|
items: I,
|
|
excluded_items: &[TerminalTitleItem],
|
|
mut value_for: F,
|
|
) -> String
|
|
where
|
|
I: IntoIterator<Item = TerminalTitleItem>,
|
|
F: FnMut(TerminalTitleItem) -> Option<String>,
|
|
{
|
|
let mut parts = vec![prefix.to_string()];
|
|
for item in items {
|
|
if item == TerminalTitleItem::Spinner || excluded_items.contains(&item) {
|
|
continue;
|
|
}
|
|
if let Some(value) = value_for(item) {
|
|
parts.push(value);
|
|
}
|
|
}
|
|
parts.join(" | ")
|
|
}
|