mirror of
https://github.com/openai/codex.git
synced 2026-11-18 15:01:48 +00:00
Separate TUI preferences from server configuration (#42202)
## Why TUI preferences and persistence paths belong to the local client, while thread configuration and account requirements may come from the active app server. Keeping both in the same resolved `Config` can replace live local preferences when a thread is resumed, forked, reconnected, or switched. ## What changed - Add `LocalSettings` as the TUI-owned source for UI, history, notice, and local persistence settings, and preserve it across session lifecycle transitions. - Write preference changes to the selected user config file and reload local settings from disk when changing roots. - Use the app server's account response for authentication-dependent onboarding and status UI instead of the local model-provider configuration. - Retain platform family and OS metadata reported by remote app servers. ## Testing - Cover local setting defaults, overrides, persistence destinations, reloads, and preservation across widget replacement and root switching. - Cover remote platform metadata and server-controlled authentication UI. GitOrigin-RevId: dbc2965fb1d6cbecb3f973f6133f3dcd4467b753
This commit is contained in:
1 parent
0b509e930e
commit
9d57be71ba
87 files changed
+1188
-459
No files matched your search
@@ -319,10 +319,10 @@ async fn backend_banner_fallback_candidates_and_notice_follow_selected_model() {
|
||||
json!(["hidden-model", "test-model-c", "test-model-b"]);
|
||||
chat.update_backend_banner(&response);
|
||||
assert_eq!(chat.backend_banner_fallback(), Some(models[2].clone()));
|
||||
// A retained ChatGPT login must not change a task using a custom provider.
|
||||
chat.config.model_provider.requires_openai_auth = false;
|
||||
// A retained ChatGPT login must not change a task whose server does not require auth.
|
||||
chat.requires_openai_auth = false;
|
||||
assert_eq!(chat.backend_banner_fallback(), None);
|
||||
chat.config.model_provider.requires_openai_auth = true;
|
||||
chat.requires_openai_auth = true;
|
||||
let mut mode = chat.effective_collaboration_mode();
|
||||
mode.settings.model = "test-model-c".into();
|
||||
chat.finish_backend_banner_fallback(mode);
|
||||
|
||||
@@ -1243,7 +1243,7 @@ async fn startup_draft_handoff_keeps_vim_insert_mode_for_nonempty_drafts() {
|
||||
let startup_draft = startup_chat.bottom_pane.composer_draft_snapshot();
|
||||
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_vim_mode_default = true;
|
||||
chat.local_settings.tui.vim_mode_default = true;
|
||||
chat.bottom_pane.set_vim_enabled(/*enabled*/ true);
|
||||
chat.restore_startup_draft(startup_draft);
|
||||
chat.bottom_pane
|
||||
|
||||
@@ -184,6 +184,8 @@ pub(super) async fn make_chatwidget_manual_with_auth(
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let model_catalog = test_model_catalog(&cfg);
|
||||
let common = ChatWidgetInit {
|
||||
requires_openai_auth: cfg.model_provider.requires_openai_auth,
|
||||
local_settings: crate::local_settings::LocalSettings::from(&cfg),
|
||||
config: cfg,
|
||||
frame_requester,
|
||||
app_event_tx,
|
||||
|
||||
@@ -14,7 +14,7 @@ async fn permission_shortcuts_cycle_builtin_modes() {
|
||||
chat.chat_keymap.previous_permission_mode = vec![crate::key_hint::plain(KeyCode::F(7))];
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
for (current, reviewer, key, expected, next_reviewer) in [
|
||||
|
||||
@@ -271,7 +271,7 @@ async fn profile_permissions_full_access_always_opens_confirmation() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.explicit_permission_profile_mode = true;
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ false);
|
||||
chat.config.notices.hide_full_access_warning = Some(true);
|
||||
chat.local_settings.notices.hide_full_access_warning = Some(true);
|
||||
|
||||
chat.open_permissions_popup();
|
||||
chat.handle_key_event(KeyEvent::from(KeyCode::Up));
|
||||
@@ -852,7 +852,7 @@ async fn permissions_selection_emits_history_cell_when_selection_changes() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ true);
|
||||
@@ -878,7 +878,7 @@ async fn permissions_selection_history_snapshot_after_mode_switch() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ false);
|
||||
@@ -915,7 +915,7 @@ async fn permissions_selection_history_snapshot_full_access_to_default() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.config
|
||||
@@ -957,7 +957,7 @@ async fn permissions_selection_emits_history_cell_when_current_is_selected() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.config
|
||||
@@ -991,7 +991,7 @@ async fn permissions_selection_hides_auto_review_when_feature_disabled() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ false);
|
||||
@@ -1010,7 +1010,7 @@ async fn permissions_selection_hides_auto_review_when_feature_disabled_even_if_a
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ false);
|
||||
@@ -1039,7 +1039,7 @@ async fn permissions_selection_marks_auto_review_current_after_session_configure
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
let _ = chat
|
||||
@@ -1084,7 +1084,7 @@ async fn permissions_selection_marks_auto_review_current_with_custom_workspace_w
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
let _ = chat
|
||||
@@ -1133,7 +1133,7 @@ async fn permissions_selection_can_disable_auto_review() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ true);
|
||||
@@ -1173,7 +1173,7 @@ async fn permissions_selection_sends_approvals_reviewer_in_override_turn_context
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ true);
|
||||
@@ -1254,7 +1254,7 @@ async fn permissions_full_access_history_cell_emitted_only_after_confirmation()
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
chat.config.notices.hide_world_writable_warning = Some(true);
|
||||
chat.local_settings.notices.hide_world_writable_warning = Some(true);
|
||||
chat.set_windows_sandbox_mode(Some(WindowsSandboxModeToml::Unelevated));
|
||||
}
|
||||
chat.set_feature_enabled(Feature::GuardianApproval, /*enabled*/ false);
|
||||
|
||||
@@ -549,7 +549,7 @@ fn plan_mode_prompt_notification_uses_dedicated_type_name() {
|
||||
#[tokio::test]
|
||||
async fn open_plan_implementation_prompt_sets_pending_notification() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.config.tui_notifications.notifications =
|
||||
chat.local_settings.tui.notification_settings.notifications =
|
||||
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
|
||||
|
||||
chat.open_plan_implementation_prompt();
|
||||
@@ -563,7 +563,7 @@ async fn open_plan_implementation_prompt_sets_pending_notification() {
|
||||
#[tokio::test]
|
||||
async fn open_plan_reasoning_scope_prompt_sets_pending_notification() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.config.tui_notifications.notifications =
|
||||
chat.local_settings.tui.notification_settings.notifications =
|
||||
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
|
||||
|
||||
chat.open_plan_reasoning_scope_prompt("gpt-5.4".to_string(), Some(ReasoningEffortConfig::High));
|
||||
@@ -624,7 +624,7 @@ async fn request_user_input_notification_overrides_pending_agent_turn_complete_n
|
||||
#[tokio::test]
|
||||
async fn handle_request_user_input_sets_pending_notification() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.config.tui_notifications.notifications =
|
||||
chat.local_settings.tui.notification_settings.notifications =
|
||||
Notifications::Custom(vec!["plan-mode-prompt".to_string()]);
|
||||
|
||||
chat.handle_request_user_input_now(ToolRequestUserInputParams {
|
||||
@@ -1630,6 +1630,8 @@ async fn make_startup_chat_with_cli_overrides(
|
||||
let resolved_model = get_model_offline_for_tests(cfg.model.as_deref());
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let init = ChatWidgetInit {
|
||||
requires_openai_auth: true,
|
||||
local_settings: crate::local_settings::LocalSettings::from(&cfg),
|
||||
config: cfg.clone(),
|
||||
frame_requester: FrameRequester::test_dummy(),
|
||||
app_event_tx: AppEventSender::new(unbounded_channel::<AppEvent>().0),
|
||||
|
||||
@@ -35,6 +35,8 @@ async fn experimental_mode_plan_is_ignored_on_startup() {
|
||||
let resolved_model = get_model_offline_for_tests(cfg.model.as_deref());
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let init = ChatWidgetInit {
|
||||
requires_openai_auth: true,
|
||||
local_settings: crate::local_settings::LocalSettings::from(&cfg),
|
||||
config: cfg.clone(),
|
||||
frame_requester: FrameRequester::test_dummy(),
|
||||
app_event_tx: AppEventSender::new(unbounded_channel::<AppEvent>().0),
|
||||
|
||||
@@ -302,7 +302,7 @@ async fn slash_side_requests_forked_side_question_while_task_running() {
|
||||
let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
let parent_thread_id = ThreadId::new();
|
||||
chat.thread_id = Some(parent_thread_id);
|
||||
chat.config.tui_status_line = Some(vec!["model-with-reasoning".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-with-reasoning".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
chat.on_task_started();
|
||||
chat.show_welcome_banner = false;
|
||||
@@ -385,7 +385,7 @@ async fn slash_btw_requests_forked_side_question_while_task_running() {
|
||||
async fn side_context_label_preserves_status_line_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
chat.set_side_conversation_active(/*active*/ true);
|
||||
chat.set_side_conversation_context_label(Some(
|
||||
@@ -427,7 +427,7 @@ async fn side_context_label_shows_parent_status_snapshot() {
|
||||
async fn side_context_label_shows_hidden_side_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
chat.set_side_conversation_context_label(Some("ctrl + / for side".to_string()));
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ async fn resumed_session_hides_unknown_token_usage_until_an_update_arrives() {
|
||||
@"(hidden)"
|
||||
);
|
||||
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"context-remaining".to_string(),
|
||||
"context-used".to_string(),
|
||||
"total-input-tokens".to_string(),
|
||||
@@ -489,6 +489,8 @@ async fn configured_pet_load_is_deferred_until_after_construction() {
|
||||
let resolved_model = get_model_offline_for_tests(cfg.model.as_deref());
|
||||
let session_telemetry = test_session_telemetry(&cfg, resolved_model.as_str());
|
||||
let init = ChatWidgetInit {
|
||||
requires_openai_auth: true,
|
||||
local_settings: crate::local_settings::LocalSettings::from(&cfg),
|
||||
config: cfg.clone(),
|
||||
frame_requester: FrameRequester::test_dummy(),
|
||||
app_event_tx: tx,
|
||||
@@ -532,10 +534,14 @@ async fn prefetch_rate_limits_is_gated_on_chatgpt_auth_provider() {
|
||||
|
||||
assert!(!chat.should_prefetch_rate_limits());
|
||||
|
||||
// The server requires auth even if the local provider does not.
|
||||
chat.config.model_provider.requires_openai_auth = false;
|
||||
set_chatgpt_auth(&mut chat);
|
||||
assert!(chat.should_prefetch_rate_limits());
|
||||
|
||||
chat.config.model_provider.requires_openai_auth = false;
|
||||
// Conversely, a local OpenAI provider cannot enable usage for a different server.
|
||||
chat.config.model_provider.requires_openai_auth = true;
|
||||
chat.requires_openai_auth = false;
|
||||
assert!(!chat.should_prefetch_rate_limits());
|
||||
|
||||
chat.prefetch_rate_limits();
|
||||
@@ -1699,7 +1705,7 @@ async fn account_update_clears_derived_usage_limit_state_and_prompt() {
|
||||
async fn rate_limit_switch_prompt_respects_hidden_notice() {
|
||||
let (mut chat, _, _) = make_chatwidget_manual(Some("gpt-5")).await;
|
||||
chat.has_chatgpt_account = true;
|
||||
chat.config.notices.hide_rate_limit_model_nudge = Some(true);
|
||||
chat.local_settings.notices.hide_rate_limit_model_nudge = Some(true);
|
||||
|
||||
chat.on_rate_limit_snapshot(Some(snapshot(/*percent*/ 95.0)));
|
||||
|
||||
@@ -2474,7 +2480,7 @@ async fn ambient_pet_screen_bottom_anchor_uses_terminal_bottom() {
|
||||
.expect("composer-anchored pet draw request");
|
||||
assert_eq!(default_draw.y, 14);
|
||||
|
||||
chat.config.tui_pet_anchor = TuiPetAnchor::ScreenBottom;
|
||||
chat.local_settings.tui.pet_anchor = TuiPetAnchor::ScreenBottom;
|
||||
let screen_bottom_draw = chat
|
||||
.ambient_pet_draw(terminal_area, composer_bottom_y)
|
||||
.expect("screen-bottom anchored pet draw request");
|
||||
@@ -2861,7 +2867,7 @@ async fn repeated_generic_warning_is_not_hidden() {
|
||||
#[tokio::test]
|
||||
async fn status_line_invalid_items_warn_once() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model_name".to_string(),
|
||||
"bogus_item".to_string(),
|
||||
"lines_changed".to_string(),
|
||||
@@ -2890,7 +2896,7 @@ async fn status_line_invalid_items_warn_once() {
|
||||
async fn status_line_hostname_renders_current_machine_hostname() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.config.tui_status_line = Some(vec!["hostname".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["hostname".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
|
||||
@@ -2905,7 +2911,7 @@ async fn status_line_hostname_renders_current_machine_hostname() {
|
||||
async fn status_line_context_used_renders_labeled_percent() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.config.tui_status_line = Some(vec!["context-used".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["context-used".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
|
||||
@@ -2920,7 +2926,7 @@ async fn status_line_context_used_renders_labeled_percent() {
|
||||
async fn status_line_context_remaining_renders_labeled_percent() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.config.tui_status_line = Some(vec!["context-remaining".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["context-remaining".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
|
||||
@@ -2938,7 +2944,7 @@ async fn status_line_context_remaining_renders_labeled_percent() {
|
||||
async fn status_line_legacy_context_usage_renders_context_used_percent() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.config.tui_status_line = Some(vec!["context-usage".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["context-usage".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
|
||||
@@ -2956,7 +2962,7 @@ async fn status_line_estimated_thread_cost_fetches_and_renders_backend_estimate(
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
assert_eq!(status_line_text(&chat), None);
|
||||
@@ -2992,7 +2998,7 @@ async fn status_line_thread_credits_fetches_and_renders_fractional_credits() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["thread-credits".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["thread-credits".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
assert_eq!(status_line_text(&chat), None);
|
||||
@@ -3028,7 +3034,7 @@ async fn status_line_thread_credits_and_cost_share_one_backend_request() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
@@ -3064,7 +3070,7 @@ async fn status_line_thread_credits_remain_visible_when_usd_is_unavailable() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
@@ -3099,8 +3105,8 @@ async fn terminal_title_thread_usage_fetches_and_renders_without_status_line() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(Vec::new());
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(Vec::new());
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
@@ -3142,8 +3148,8 @@ async fn terminal_title_thread_credits_remain_visible_when_usd_is_unavailable()
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(Vec::new());
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(Vec::new());
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
@@ -3178,8 +3184,8 @@ async fn terminal_title_and_status_line_share_one_thread_usage_request() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.config.tui_terminal_title = Some(vec!["thread-credits".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.terminal_title = Some(vec!["thread-credits".to_string()]);
|
||||
|
||||
chat.refresh_status_surfaces();
|
||||
let request_id = match rx.try_recv() {
|
||||
@@ -3211,7 +3217,7 @@ async fn status_line_estimated_thread_cost_avoids_unsupported_plan_requests() {
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Pro);
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"estimated-thread-cost".to_string(),
|
||||
"run-state".to_string(),
|
||||
]);
|
||||
@@ -3232,7 +3238,7 @@ async fn status_line_estimated_thread_cost_stops_after_backend_disables_feature(
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::EnterpriseCbpAutomation);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
let request_id = match rx.try_recv() {
|
||||
Ok(AppEvent::RefreshThreadUsage { request_id, .. }) => request_id,
|
||||
@@ -3257,7 +3263,7 @@ async fn status_line_estimated_thread_cost_preserves_cached_amount_during_settle
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
let initial_request_id = match rx.try_recv() {
|
||||
Ok(AppEvent::RefreshThreadUsage { request_id, .. }) => request_id,
|
||||
@@ -3304,7 +3310,7 @@ async fn completed_turn_refreshes_estimated_thread_cost() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
|
||||
let initial_request_id = match rx.try_recv() {
|
||||
@@ -3355,8 +3361,8 @@ async fn completed_turn_refreshes_credits_only_terminal_title() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(Vec::new());
|
||||
chat.config.tui_terminal_title = Some(vec!["thread-credits".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(Vec::new());
|
||||
chat.local_settings.tui.terminal_title = Some(vec!["thread-credits".to_string()]);
|
||||
chat.refresh_terminal_title();
|
||||
|
||||
let initial_request_id = match rx.try_recv() {
|
||||
@@ -3407,7 +3413,7 @@ async fn interrupted_turn_refreshes_estimated_thread_usage() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
|
||||
let initial_request_id = match rx.try_recv() {
|
||||
@@ -3448,7 +3454,7 @@ async fn failed_turn_refreshes_estimated_thread_usage() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
|
||||
let initial_request_id = match rx.try_recv() {
|
||||
@@ -3493,7 +3499,7 @@ async fn status_line_estimated_thread_cost_rejects_stale_thread_completions() {
|
||||
chat.thread_id = Some(previous_thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["estimated-thread-cost".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
let previous_request_id = match rx.try_recv() {
|
||||
Ok(AppEvent::RefreshThreadUsage { request_id, .. }) => request_id,
|
||||
@@ -3542,7 +3548,7 @@ async fn status_line_estimated_thread_cost_footer_snapshot() {
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
@@ -3579,7 +3585,7 @@ async fn status_line_estimated_thread_cost_footer_snapshot() {
|
||||
async fn status_line_workspace_headline_renders_cached_value() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.status_line_workspace_headline = Some("Workspace maintenance starts at 5pm".to_string());
|
||||
|
||||
chat.refresh_status_line();
|
||||
@@ -3598,7 +3604,7 @@ async fn status_line_workspace_headline_renders_cached_value() {
|
||||
async fn status_line_workspace_headline_omits_when_unavailable() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_id = Some(ThreadId::new());
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"workspace-headline".to_string(),
|
||||
"run-state".to_string(),
|
||||
]);
|
||||
@@ -3615,7 +3621,7 @@ async fn status_line_workspace_headline_omits_when_unavailable() {
|
||||
#[tokio::test]
|
||||
async fn workspace_headline_update_applies_feature_disabled_result() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.status_line_workspace_headline = Some("Old headline".to_string());
|
||||
let request_id = 3;
|
||||
chat.status_line_workspace_headline_pending_request_id = Some(request_id);
|
||||
@@ -3632,7 +3638,7 @@ async fn workspace_headline_update_applies_feature_disabled_result() {
|
||||
#[tokio::test]
|
||||
async fn workspace_headline_update_applies_available_headline() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
let request_id = 4;
|
||||
chat.status_line_workspace_headline_pending_request_id = Some(request_id);
|
||||
|
||||
@@ -3655,7 +3661,7 @@ async fn workspace_headline_update_applies_available_headline() {
|
||||
#[tokio::test]
|
||||
async fn account_update_clears_workspace_headline_state() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.status_line_workspace_headline = Some("Old workspace headline".to_string());
|
||||
chat.status_line_workspace_headline_pending_request_id = Some(5);
|
||||
chat.status_line_workspace_headline_last_requested_at = Some(Instant::now());
|
||||
@@ -3680,7 +3686,7 @@ async fn account_update_clears_workspace_headline_state() {
|
||||
#[tokio::test]
|
||||
async fn workspace_headline_fetch_allows_backend_auth_without_chatgpt_account() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
|
||||
chat.update_account_state(
|
||||
/*status_account_display*/ None, /*plan_type*/ None,
|
||||
@@ -3697,7 +3703,7 @@ async fn workspace_headline_fetch_allows_backend_auth_without_chatgpt_account()
|
||||
#[tokio::test]
|
||||
async fn account_update_discards_stale_workspace_headline_results() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
|
||||
chat.update_account_state(
|
||||
Some(StatusAccountDisplay::ChatGpt {
|
||||
@@ -3767,7 +3773,7 @@ async fn status_line_branch_state_resets_when_git_branch_disabled() {
|
||||
chat.status_line_branch = Some("main".to_string());
|
||||
chat.status_line_branch_pending = true;
|
||||
chat.status_line_branch_lookup_complete = true;
|
||||
chat.config.tui_status_line = Some(vec!["model_name".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model_name".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
|
||||
@@ -3780,7 +3786,7 @@ async fn status_line_branch_state_resets_when_git_branch_disabled() {
|
||||
async fn status_line_branch_refreshes_after_turn_complete() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
install_noop_workspace_command_runner(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec!["git-branch".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["git-branch".to_string()]);
|
||||
chat.status_line_branch_lookup_complete = true;
|
||||
chat.status_line_branch_pending = false;
|
||||
|
||||
@@ -3793,7 +3799,7 @@ async fn status_line_branch_refreshes_after_turn_complete() {
|
||||
async fn status_line_branch_refreshes_after_interrupt() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
install_noop_workspace_command_runner(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec!["git-branch".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["git-branch".to_string()]);
|
||||
chat.status_line_branch_lookup_complete = true;
|
||||
chat.status_line_branch_pending = false;
|
||||
|
||||
@@ -3891,7 +3897,7 @@ async fn completed_turn_clears_visible_running_hook() {
|
||||
async fn status_line_fast_mode_renders_on_and_off() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec!["fast-mode".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["fast-mode".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
assert_eq!(status_line_text(&chat), Some("Fast off".to_string()));
|
||||
@@ -3905,7 +3911,7 @@ async fn status_line_fast_mode_renders_on_and_off() {
|
||||
async fn status_line_fast_mode_updates_visibility_on_model_change() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec!["fast-mode".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["fast-mode".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
assert_eq!(status_line_text(&chat), Some("Fast off".to_string()));
|
||||
@@ -3930,7 +3936,7 @@ async fn status_line_fast_mode_footer_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"fast-mode".to_string(),
|
||||
]);
|
||||
@@ -3955,7 +3961,7 @@ async fn status_line_model_with_reasoning_includes_fast_for_fast_capable_models(
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
assert!(get_available_model(&chat, "gpt-5.4").supports_fast_mode());
|
||||
chat.config.cwd = test_project_path().abs();
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"context-used".to_string(),
|
||||
"current-dir".to_string(),
|
||||
@@ -3985,7 +3991,7 @@ async fn status_line_model_with_reasoning_includes_fast_for_fast_capable_models(
|
||||
#[tokio::test]
|
||||
async fn terminal_title_model_updates_on_model_change_without_manual_refresh() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.config.tui_terminal_title = Some(vec!["model".to_string()]);
|
||||
chat.local_settings.tui.terminal_title = Some(vec!["model".to_string()]);
|
||||
chat.refresh_terminal_title();
|
||||
|
||||
assert_eq!(chat.last_terminal_title, Some("gpt-5.4".to_string()));
|
||||
@@ -3998,8 +4004,8 @@ async fn terminal_title_model_updates_on_model_change_without_manual_refresh() {
|
||||
#[tokio::test]
|
||||
async fn status_line_and_terminal_title_reasoning_render_only_effort() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.config.tui_status_line = Some(vec!["reasoning".to_string()]);
|
||||
chat.config.tui_terminal_title = Some(vec!["reasoning".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["reasoning".to_string()]);
|
||||
chat.local_settings.tui.terminal_title = Some(vec!["reasoning".to_string()]);
|
||||
chat.set_reasoning_effort(Some(ReasoningEffortConfig::XHigh));
|
||||
chat.set_service_tier(Some(ServiceTier::Fast.request_value().to_string()));
|
||||
|
||||
@@ -4014,7 +4020,7 @@ async fn status_line_and_terminal_title_reasoning_render_only_effort() {
|
||||
async fn status_line_reasoning_updates_on_mode_switch_without_manual_refresh() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
|
||||
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
|
||||
chat.config.tui_status_line = Some(vec!["reasoning".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["reasoning".to_string()]);
|
||||
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
|
||||
|
||||
assert_eq!(status_line_text(&chat), Some("high".to_string()));
|
||||
@@ -4030,7 +4036,7 @@ async fn status_line_reasoning_updates_on_mode_switch_without_manual_refresh() {
|
||||
async fn status_line_model_with_reasoning_updates_on_mode_switch_without_manual_refresh() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
|
||||
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
|
||||
chat.config.tui_status_line = Some(vec!["model-with-reasoning".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-with-reasoning".to_string()]);
|
||||
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
|
||||
|
||||
assert_eq!(status_line_text(&chat), Some("gpt-5.2 high".to_string()));
|
||||
@@ -4056,7 +4062,7 @@ async fn status_line_model_with_reasoning_plan_mode_footer_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
|
||||
chat.show_welcome_banner = false;
|
||||
chat.set_feature_enabled(Feature::CollaborationModes, /*enabled*/ true);
|
||||
chat.config.tui_status_line = Some(vec!["model-with-reasoning".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-with-reasoning".to_string()]);
|
||||
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
|
||||
|
||||
let plan_mask = collaboration_modes::plan_mask(chat.model_catalog.as_ref())
|
||||
@@ -4082,7 +4088,7 @@ async fn renamed_thread_footer_title_snapshot() {
|
||||
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"thread-title".to_string(),
|
||||
]);
|
||||
@@ -4123,7 +4129,7 @@ async fn status_line_model_with_reasoning_fast_footer_snapshot() {
|
||||
assert!(get_available_model(&chat, "gpt-5.4").supports_fast_mode());
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.cwd = test_project_path().abs();
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"context-used".to_string(),
|
||||
"current-dir".to_string(),
|
||||
@@ -4157,7 +4163,7 @@ async fn status_line_model_with_reasoning_context_remaining_footer_snapshot() {
|
||||
assert!(get_available_model(&chat, "gpt-5.4").supports_fast_mode());
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.cwd = test_project_path().abs();
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"context-remaining".to_string(),
|
||||
"current-dir".to_string(),
|
||||
@@ -4189,7 +4195,7 @@ async fn status_line_goal_active_token_budget_footer_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.set_feature_enabled(Feature::Goals, /*enabled*/ true);
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
chat.handle_server_notification(
|
||||
ServerNotification::ThreadGoalUpdated(
|
||||
@@ -4226,7 +4232,7 @@ async fn status_line_goal_complete_elapsed_footer_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
chat.set_feature_enabled(Feature::Goals, /*enabled*/ true);
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["model-name".to_string()]);
|
||||
chat.refresh_status_line();
|
||||
let mut goal = test_thread_goal(
|
||||
codex_app_server_protocol::ThreadGoalStatus::Complete,
|
||||
|
||||
@@ -127,7 +127,7 @@ async fn status_line_setup_popup_live_only_snapshot() {
|
||||
cache_project_root(&mut chat, "preview-live-root");
|
||||
chat.status_line_branch = Some("feature/live-preview-branch".to_string());
|
||||
chat.thread_name = Some("Live preview thread".to_string());
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"project-name".to_string(),
|
||||
"git-branch".to_string(),
|
||||
"thread-title".to_string(),
|
||||
@@ -181,7 +181,7 @@ async fn thread_title_falls_back_to_thread_id_when_unnamed() {
|
||||
#[tokio::test]
|
||||
async fn status_line_setup_popup_hardcoded_only_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"project-name".to_string(),
|
||||
"git-branch".to_string(),
|
||||
"thread-title".to_string(),
|
||||
@@ -197,7 +197,7 @@ async fn status_line_setup_popup_hardcoded_only_snapshot() {
|
||||
async fn status_line_setup_popup_workspace_headline_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.status_line_workspace_headline = Some("Workspace maintenance starts at 5pm".to_string());
|
||||
chat.config.tui_status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
chat.local_settings.tui.status_line = Some(vec!["workspace-headline".to_string()]);
|
||||
|
||||
assert_chatwidget_snapshot!(
|
||||
"status_line_setup_popup_workspace_headline",
|
||||
@@ -252,11 +252,11 @@ async fn status_surface_preview_lines_thread_usage_snapshot() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
@@ -299,11 +299,11 @@ async fn status_surface_thread_usage_previews_omit_unavailable_usd_estimates() {
|
||||
chat.thread_id = Some(thread_id);
|
||||
chat.has_codex_backend_auth = true;
|
||||
chat.plan_type = Some(PlanType::Business);
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
@@ -393,7 +393,7 @@ async fn status_surface_preview_omits_unavailable_rate_limit_items() {
|
||||
async fn status_line_setup_popup_rate_limits_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
cache_rate_limit_snapshot(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"five-hour-limit".to_string(),
|
||||
"weekly-limit".to_string(),
|
||||
]);
|
||||
@@ -409,7 +409,7 @@ async fn status_line_setup_popup_mixed_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.status_line_branch = Some("feature/mixed-preview".to_string());
|
||||
chat.thread_name = Some("Mixed preview thread".to_string());
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
chat.local_settings.tui.status_line = Some(vec![
|
||||
"project-name".to_string(),
|
||||
"git-branch".to_string(),
|
||||
"thread-title".to_string(),
|
||||
@@ -428,7 +428,7 @@ async fn terminal_title_setup_popup_live_only_snapshot() {
|
||||
chat.status_line_branch = Some("feature/live-preview-branch".to_string());
|
||||
chat.thread_name = Some("Live preview thread".to_string());
|
||||
chat.transcript.last_plan_progress = Some((2, 5));
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"project-name".to_string(),
|
||||
"thread-title".to_string(),
|
||||
"git-branch".to_string(),
|
||||
@@ -444,7 +444,7 @@ async fn terminal_title_setup_popup_live_only_snapshot() {
|
||||
#[tokio::test]
|
||||
async fn terminal_title_setup_popup_hardcoded_only_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"thread-title".to_string(),
|
||||
"git-branch".to_string(),
|
||||
"task-progress".to_string(),
|
||||
@@ -460,7 +460,7 @@ async fn terminal_title_setup_popup_hardcoded_only_snapshot() {
|
||||
async fn terminal_title_setup_popup_mixed_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.thread_name = Some("Mixed preview thread".to_string());
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"project-name".to_string(),
|
||||
"thread-title".to_string(),
|
||||
"task-progress".to_string(),
|
||||
@@ -476,7 +476,7 @@ async fn terminal_title_setup_popup_mixed_snapshot() {
|
||||
async fn terminal_title_setup_popup_rate_limits_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
cache_rate_limit_snapshot(&mut chat);
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"five-hour-limit".to_string(),
|
||||
"weekly-limit".to_string(),
|
||||
]);
|
||||
@@ -490,7 +490,7 @@ async fn terminal_title_setup_popup_rate_limits_snapshot() {
|
||||
#[tokio::test]
|
||||
async fn terminal_title_setup_popup_thread_usage_snapshot() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_terminal_title = Some(vec![
|
||||
chat.local_settings.tui.terminal_title = Some(vec![
|
||||
"thread-credits".to_string(),
|
||||
"estimated-thread-cost".to_string(),
|
||||
]);
|
||||
|
||||
@@ -127,13 +127,13 @@ async fn terminal_title_shows_action_required_while_exec_approval_is_pending() {
|
||||
assert!(chat.should_animate_terminal_title_spinner());
|
||||
|
||||
for (animations, title_items) in [(false, None), (true, Some(Vec::new()))] {
|
||||
chat.config.animations = true;
|
||||
chat.config.tui_terminal_title = None;
|
||||
chat.local_settings.tui.animations = true;
|
||||
chat.local_settings.tui.terminal_title = None;
|
||||
chat.refresh_terminal_title();
|
||||
assert!(chat.terminal_title_next_refresh.is_some());
|
||||
|
||||
chat.config.animations = animations;
|
||||
chat.config.tui_terminal_title = title_items;
|
||||
chat.local_settings.tui.animations = animations;
|
||||
chat.local_settings.tui.terminal_title = title_items;
|
||||
chat.refresh_terminal_title();
|
||||
assert!(chat.terminal_title_next_refresh.is_none());
|
||||
}
|
||||
@@ -142,7 +142,7 @@ async fn terminal_title_shows_action_required_while_exec_approval_is_pending() {
|
||||
#[tokio::test]
|
||||
async fn terminal_title_action_required_respects_spinner_setting() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.tui_terminal_title = Some(vec!["project".to_string()]);
|
||||
chat.local_settings.tui.terminal_title = Some(vec!["project".to_string()]);
|
||||
chat.bottom_pane.set_task_running(/*running*/ true);
|
||||
chat.refresh_terminal_title();
|
||||
|
||||
@@ -206,7 +206,7 @@ async fn terminal_title_action_required_blinks_when_animations_are_enabled() {
|
||||
#[tokio::test]
|
||||
async fn terminal_title_activity_indicators_do_not_animate_when_animations_are_disabled() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.config.animations = false;
|
||||
chat.local_settings.tui.animations = false;
|
||||
chat.bottom_pane.set_task_running(/*running*/ true);
|
||||
chat.terminal_title_animation_origin = Instant::now() - std::time::Duration::from_millis(1500);
|
||||
chat.refresh_terminal_title();
|
||||
|
||||
Reference in new issue
Block a user