diff --git a/akode-rs/tui/src/app/tests/new_session_tests.rs b/akode-rs/tui/src/app/tests/new_session_tests.rs index ead33fe4..5d531b72 100644 --- a/akode-rs/tui/src/app/tests/new_session_tests.rs +++ b/akode-rs/tui/src/app/tests/new_session_tests.rs @@ -37,8 +37,7 @@ async fn new_session_refreshes_account_for_the_started_provider() -> Result<()> crate::test_support::with_test_model_provider( &home.path(), format!( - "model_provider = 'ollama'\nmodel = 'test-model'\ncli_auth_credentials_store = 'file'\nchatgpt_base_url = {:?}\nmodel_catalog_json = {catalog_path:?}\nfeatures.apps = true\n\n[model_providers.mock]\nname = 'Mock'\nbase_url = {:?}\nwire_api = 'responses'\nrequires_openai_auth = true\n", - backend.uri(), + "model_provider = 'ollama'\nmodel = 'test-model'\ncli_auth_credentials_store = 'file'\nmodel_catalog_json = {catalog_path:?}\nfeatures.apps = true\n\n[model_providers.mock]\nname = 'Mock'\nbase_url = {:?}\nwire_api = 'responses'\nrequires_openai_auth = true\n", format!("{}/v1", backend.uri()), ), ), diff --git a/akode-rs/tui/src/app/tests/session_lifecycle_requests.rs b/akode-rs/tui/src/app/tests/session_lifecycle_requests.rs index 0b282143..fa9b0e7c 100644 --- a/akode-rs/tui/src/app/tests/session_lifecycle_requests.rs +++ b/akode-rs/tui/src/app/tests/session_lifecycle_requests.rs @@ -2437,7 +2437,6 @@ async fn check_dynamic_tool_requests( let (mut app, mut events, _ops) = make_test_app_with_channels().await; let codex_home = tempdir()?; let backend = wiremock::MockServer::start().await; - let backend_url = format!("{}/backend-api", backend.uri()); let api_url = format!("{}/v1", backend.uri()); app.config.model_provider.base_url = Some(api_url.clone()); app.config.codex_home = codex_home.path().to_path_buf().abs(); @@ -2452,12 +2451,11 @@ async fn check_dynamic_tool_requests( crate::test_support::with_test_model_provider( &codex_home.path(), format!( - "model_catalog_json = {:?}\nchatgpt_base_url = {backend_url:?}\ncli_auth_credentials_store = \"file\"\nopenai_base_url = {api_url:?}\n", + "model_catalog_json = {:?}\ncli_auth_credentials_store = \"file\"\nopenai_base_url = {api_url:?}\n", catalog_path.display().to_string() ), ), )?; - app.config.chatgpt_base_url = backend_url; app.config.model_catalog = Some(catalog); app.config.cli_auth_credentials_store_mode = akode_login::AuthCredentialsStoreMode::File; assert_eq!(auth_mode, akode_app_server_protocol::AuthMode::ApiKey); diff --git a/akode-rs/tui/src/app/tests/snapshots/akode_tui__app__tests__safety_buffering__safety_recourse.snap b/akode-rs/tui/src/app/tests/snapshots/akode_tui__app__tests__safety_buffering__safety_recourse.snap index a37420de..bfcf423b 100644 --- a/akode-rs/tui/src/app/tests/snapshots/akode_tui__app__tests__safety_buffering__safety_recourse.snap +++ b/akode-rs/tui/src/app/tests/snapshots/akode_tui__app__tests__safety_buffering__safety_recourse.snap @@ -5,11 +5,9 @@ expression: "format!(\"{loading}\\n\\n{notice}\")" ⓘ This content can’t be shown We take extra care with some cybersecurity requests. Some cybersecurity requests are limited. - Learn more: https://help.openai.com/en/articles/20001326 • Finding an explanation and safer ways to continue… ⓘ This content can’t be shown We take extra caution with requests that could enable access to accounts or systems beyond permitted scope. We can still help with an overview of account security and recovery. Some cybersecurity requests are limited. - Learn more: https://help.openai.com/en/articles/20001326 diff --git a/akode-rs/tui/src/chatwidget/plugin_catalog.rs b/akode-rs/tui/src/chatwidget/plugin_catalog.rs index 6aa04e84..2d08a52f 100644 --- a/akode-rs/tui/src/chatwidget/plugin_catalog.rs +++ b/akode-rs/tui/src/chatwidget/plugin_catalog.rs @@ -22,7 +22,6 @@ use crate::key_hint; use crate::legacy_core::config::Config; use crate::motion::MotionMode; use crate::motion::shimmer_text; -use crate::onboarding::mark_url_hyperlink; use crate::render::renderable::ColumnRenderable; use crate::render::renderable::Renderable; use crate::tui::FrameRequester; @@ -53,7 +52,6 @@ const OPENAI_CURATED_TAB_ID: &str = "marketplace:openai-curated"; const PLUGIN_ROW_PREFIX_WIDTH: usize = 6; const LOADING_ANIMATION_DELAY: Duration = Duration::from_secs(1); const LOADING_ANIMATION_INTERVAL: Duration = Duration::from_millis(100); -const APPS_HELP_ARTICLE_URL: &str = "https://help.openai.com/en/articles/11487775-apps-in-chatgpt"; const PERSONAL_MARKETPLACE_RELATIVE_PATH: &str = ".agents/plugins/marketplace.json"; const LOCAL_MARKETPLACE_TAB_ORDER: u8 = 0; const OTHER_MARKETPLACE_TAB_ORDER: u8 = 1; @@ -181,7 +179,6 @@ impl Renderable for PluginDisclosureLine { Paragraph::new(self.line.clone()) .wrap(Wrap { trim: false }) .render(area, buf); - mark_url_hyperlink(buf, area, APPS_HELP_ARTICLE_URL); } fn desired_height(&self, width: u16) -> u16 { @@ -800,8 +797,6 @@ impl ChatWidget { "terms of service".bold(), " and ".into(), "privacy policy".bold(), - ". ".into(), - "Learn more".cyan().underlined(), ".".into(), ]), }); diff --git a/akode-rs/tui/src/chatwidget/safety_buffering.rs b/akode-rs/tui/src/chatwidget/safety_buffering.rs index 00e32813..e6ff89ed 100644 --- a/akode-rs/tui/src/chatwidget/safety_buffering.rs +++ b/akode-rs/tui/src/chatwidget/safety_buffering.rs @@ -6,7 +6,6 @@ use crate::wrapping::word_wrap_lines; use akode_app_server_protocol::ModelSafetyBufferingUpdatedNotification; const SAFETY_BUFFERING_PROMPT_VIEW_ID: &str = "safety-buffering-prompt"; -const SAFETY_BUFFERING_LEARN_MORE_URL: &str = "https://help.openai.com/en/articles/20001326"; const SAFETY_BUFFERING_HEADER: &str = "Giving this request a little extra thought"; const SAFETY_BUFFERING_MESSAGE_WITH_RETRY: &str = "If you'd rather not wait, retry with a faster model. It may be less capable of handling complex requests."; @@ -211,22 +210,11 @@ impl ChatWidget { ..Default::default() }); } - items.extend([ - SelectionItem { - name: "Dismiss and keep waiting".to_string(), - dismiss_on_select: true, - ..Default::default() - }, - SelectionItem { - name: "Learn more".to_string(), - actions: vec![Box::new(|tx| { - tx.send(AppEvent::OpenUrlInBrowser { - url: SAFETY_BUFFERING_LEARN_MORE_URL.to_string(), - }); - })], - ..Default::default() - }, - ]); + items.push(SelectionItem { + name: "Dismiss and keep waiting".to_string(), + dismiss_on_select: true, + ..Default::default() + }); self.bottom_pane.show_selection_view(SelectionViewParams { view_id: Some(SAFETY_BUFFERING_PROMPT_VIEW_ID), header: Box::new(SafetyBufferingHeader(header)), diff --git a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__cyber_refusal_parent_owned.snap b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__cyber_refusal_parent_owned.snap index f2183f84..854ef12d 100644 --- a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__cyber_refusal_parent_owned.snap +++ b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__cyber_refusal_parent_owned.snap @@ -6,7 +6,6 @@ expression: "normalize_snapshot_paths(format!(\"{}\\n{}\",\nlines_to_single_stri ⓘ This content can’t be shown We take extra care with some cybersecurity requests. Some cybersecurity requests are limited. - Learn more: https://help.openai.com/en/articles/20001326 › Viewing sub-agent — direct input is disabled diff --git a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_installable.snap b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_installable.snap index 9a08d197..28ed1c5a 100644 --- a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_installable.snap +++ b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_installable.snap @@ -4,8 +4,7 @@ expression: strip_osc8_for_snapshot(&popup) --- Plugins Figma · Can be installed · Local - Data shared with this app is subject to the app's terms of service and privacy policy. Learn - more. + Data shared with this app is subject to the app's terms of service and privacy policy. Turn Figma files into implementation context. diff --git a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_npm_source.snap b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_npm_source.snap index 5d68af4f..b968556f 100644 --- a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_npm_source.snap +++ b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__plugin_detail_popup_npm_source.snap @@ -4,8 +4,7 @@ expression: strip_osc8_for_snapshot(&popup) --- Plugins Figma · Can be installed · ChatGPT Marketplace - Data shared with this app is subject to the app's terms of service and privacy policy. Learn - more. + Data shared with this app is subject to the app's terms of service and privacy policy. Turn Figma files into implementation context. diff --git a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_retry_prompt.snap b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_retry_prompt.snap index e5cbe33b..7021a227 100644 --- a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_retry_prompt.snap +++ b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_retry_prompt.snap @@ -9,7 +9,6 @@ expression: popup › 1. Retry with a faster model 2. Dismiss and keep waiting - 3. Learn more No action is required. Codex will keep waiting, and this menu will close when the response is ready. diff --git a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_side_conversation_without_retry.snap b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_side_conversation_without_retry.snap index eb482d53..e855f9e2 100644 --- a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_side_conversation_without_retry.snap +++ b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_side_conversation_without_retry.snap @@ -6,7 +6,6 @@ expression: popup › 1. Dismiss and keep waiting - 2. Learn more No action is required. Codex will keep waiting, and this menu will close when the response is ready. diff --git a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_status_without_retry.snap b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_status_without_retry.snap index eb482d53..e855f9e2 100644 --- a/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_status_without_retry.snap +++ b/akode-rs/tui/src/chatwidget/snapshots/akode_tui__chatwidget__tests__safety_buffering_status_without_retry.snap @@ -6,7 +6,6 @@ expression: popup › 1. Dismiss and keep waiting - 2. Learn more No action is required. Codex will keep waiting, and this menu will close when the response is ready. diff --git a/akode-rs/tui/src/chatwidget/tests/app_server.rs b/akode-rs/tui/src/chatwidget/tests/app_server.rs index 26d78ce4..2d3393b3 100644 --- a/akode-rs/tui/src/chatwidget/tests/app_server.rs +++ b/akode-rs/tui/src/chatwidget/tests/app_server.rs @@ -276,23 +276,11 @@ async fn safety_buffering_offers_one_retry_with_app_wording() { ); let popup = render_bottom_popup(&chat, /*width*/ 80); + assert!(!popup.contains("Learn more")); assert_chatwidget_snapshot!("safety_buffering_retry_prompt", popup); - chat.handle_key_event(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE)); - chat.handle_key_event(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE)); - chat.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE)); - let opened_url = loop { - match rx.try_recv() { - Ok(AppEvent::OpenUrlInBrowser { url }) => break url, - Ok(_) => continue, - Err(err) => panic!("expected learn-more URL event: {err}"), - } - }; - assert_eq!(opened_url, "https://help.openai.com/en/articles/20001326"); assert!(render_bottom_popup(&chat, /*width*/ 80).contains(SAFETY_BUFFERING_HEADER_TEXT)); - chat.handle_key_event(KeyEvent::new(KeyCode::Up, KeyModifiers::NONE)); - chat.handle_key_event(KeyEvent::new(KeyCode::Up, KeyModifiers::NONE)); open_safety_buffering_retry_confirmation(&mut chat, &mut rx); assert_chatwidget_snapshot!( "safety_buffering_retry_confirmation", diff --git a/akode-rs/tui/src/chatwidget/tests/snapshots/akode_tui__chatwidget__tests__app_server__app_server_bio_policy_error_renders_dedicated_notice.snap b/akode-rs/tui/src/chatwidget/tests/snapshots/akode_tui__chatwidget__tests__app_server__app_server_bio_policy_error_renders_dedicated_notice.snap index 4246aa9a..5edcfa84 100644 --- a/akode-rs/tui/src/chatwidget/tests/snapshots/akode_tui__chatwidget__tests__app_server__app_server_bio_policy_error_renders_dedicated_notice.snap +++ b/akode-rs/tui/src/chatwidget/tests/snapshots/akode_tui__chatwidget__tests__app_server__app_server_bio_policy_error_renders_dedicated_notice.snap @@ -4,7 +4,5 @@ expression: rendered_cases.last().unwrap().1.as_str() --- ⓘ This content can't be shown We take extra caution with requests involving biological research and - applications that could pose safety risks. Eligible researchers can apply - for Trusted Access. - Trusted Access: https://chatgpt.com/r/b749fb02595e04c3007a54375f3f4374 - Learn more: https://help.openai.com/en/articles/20001326 + applications that could pose safety risks. Some biological research requests + are limited. diff --git a/akode-rs/tui/src/chatwidget/tests/status_and_layout.rs b/akode-rs/tui/src/chatwidget/tests/status_and_layout.rs index 599c3ad9..18e1ae3b 100644 --- a/akode-rs/tui/src/chatwidget/tests/status_and_layout.rs +++ b/akode-rs/tui/src/chatwidget/tests/status_and_layout.rs @@ -121,9 +121,10 @@ async fn app_server_cyber_policy_error_renders_dedicated_notice() { let cells = drain_insert_history(&mut rx); assert_eq!(cells.len(), 1); let rendered = lines_to_single_string(&cells[0]); - assert!(rendered.contains("This content can’t be shown")); - assert!(rendered.contains("We take extra care with some cybersecurity requests")); - assert!(rendered.contains("Learn more")); + let flattened = rendered.split_whitespace().collect::>().join(" "); + assert!(flattened.contains("This content can’t be shown")); + assert!(flattened.contains("We take extra care with some cybersecurity requests")); + assert!(flattened.contains("Some cybersecurity requests are limited.")); assert!(!rendered.contains("server fallback message")); } diff --git a/akode-rs/tui/src/history_cell/notices.rs b/akode-rs/tui/src/history_cell/notices.rs index 8034cb64..663ff646 100644 --- a/akode-rs/tui/src/history_cell/notices.rs +++ b/akode-rs/tui/src/history_cell/notices.rs @@ -147,23 +147,13 @@ pub(crate) struct SafetyAccessBlockCell { title: &'static str, pub(crate) explanation: Option, body: &'static str, - actions: &'static [(&'static str, &'static str)], } -const SAFETY_ACCESS_BLOCK_LEARN_MORE_URL: &str = "https://help.openai.com/en/articles/20001326"; - pub(crate) fn new_safety_access_block_event() -> SafetyAccessBlockCell { SafetyAccessBlockCell { title: "This content can't be shown", explanation: Some("We take extra caution with requests involving biological research and applications that could pose safety risks.".into()), - body: "Eligible researchers can apply for Trusted Access.", - actions: &[ - ( - "Trusted Access", - "https://chatgpt.com/r/b749fb02595e04c3007a54375f3f4374", - ), - ("Learn more", SAFETY_ACCESS_BLOCK_LEARN_MORE_URL), - ], + body: "Some biological research requests are limited.", } } @@ -172,7 +162,6 @@ pub(crate) fn new_cyber_policy_error_event() -> SafetyAccessBlockCell { title: "This content can’t be shown", explanation: Some("We take extra care with some cybersecurity requests.".into()), body: "Some cybersecurity requests are limited.", - actions: &[("Learn more", SAFETY_ACCESS_BLOCK_LEARN_MORE_URL)], } } @@ -203,37 +192,11 @@ impl HistoryCell for SafetyAccessBlockCell { let mut wrapped_body = Vec::new(); push_owned_lines(&wrapped, &mut wrapped_body); lines.extend(plain_hyperlink_lines(wrapped_body)); - - for &(label, url) in self.actions { - let source = crate::terminal_hyperlinks::annotate_web_urls_in_line( - vec![ - format!(" {label}: ").dim(), - url.fg(accent_color()).underlined(), - ] - .into(), - ); - let wrapped = crate::wrapping::word_wrap_line( - &source.line, - RtOptions::new(wrap_width).subsequent_indent(" ".into()), - ); - let mut wrapped_links = Vec::new(); - push_owned_lines(&wrapped, &mut wrapped_links); - lines.extend(crate::terminal_hyperlinks::remap_wrapped_line( - &source, - wrapped_links, - )); - } lines } fn raw_lines(&self) -> Vec> { - let mut lines = vec![Line::from(self.title), Line::from(self.message())]; - lines.extend( - self.actions - .iter() - .map(|(label, target)| Line::from(format!("{label}: {target}"))), - ); - lines + vec![Line::from(self.title), Line::from(self.message())] } fn transcript_hyperlink_lines(&self, width: u16) -> Vec { diff --git a/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_narrow_snapshot.snap b/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_narrow_snapshot.snap index df909b9b..9b2f75ef 100644 --- a/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_narrow_snapshot.snap +++ b/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_narrow_snapshot.snap @@ -7,6 +7,3 @@ expression: rendered cybersecurity requests. Some cybersecurity requests are limited. - Learn more: https:// - help.openai.com/en/ - articles/20001326 diff --git a/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_snapshot.snap b/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_snapshot.snap index b1a11ebd..f715c5c1 100644 --- a/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_snapshot.snap +++ b/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__cyber_policy_error_event_snapshot.snap @@ -5,4 +5,3 @@ expression: rendered ⓘ This content can’t be shown We take extra care with some cybersecurity requests. Some cybersecurity requests are limited. - Learn more: https://help.openai.com/en/articles/20001326 diff --git a/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__safety_access_block_event_snapshot.snap b/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__safety_access_block_event_snapshot.snap index c75c15ed..05f182b8 100644 --- a/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__safety_access_block_event_snapshot.snap +++ b/akode-rs/tui/src/history_cell/snapshots/akode_tui__history_cell__tests__safety_access_block_event_snapshot.snap @@ -4,7 +4,5 @@ expression: rendered --- ⓘ This content can't be shown We take extra caution with requests involving biological research and - applications that could pose safety risks. Eligible researchers can apply - for Trusted Access. - Trusted Access: https://chatgpt.com/r/b749fb02595e04c3007a54375f3f4374 - Learn more: https://help.openai.com/en/articles/20001326 + applications that could pose safety risks. Some biological research requests + are limited. diff --git a/akode-rs/tui/src/onboarding/mod.rs b/akode-rs/tui/src/onboarding/mod.rs index be167c3a..ebf94942 100644 --- a/akode-rs/tui/src/onboarding/mod.rs +++ b/akode-rs/tui/src/onboarding/mod.rs @@ -12,7 +12,6 @@ pub(crate) use provider_setup::FieldDisplay; pub(crate) use provider_setup::ProviderInput; pub(crate) use provider_setup::move_provider_field; mod trust_directory; -pub(crate) use auth::mark_url_hyperlink; pub(crate) use onboarding_screen::DirectoryTrustOptions; pub(crate) use trust_directory::TrustCancelAction; mod welcome; diff --git a/akode-rs/tui/src/terminal_hyperlinks.rs b/akode-rs/tui/src/terminal_hyperlinks.rs index 3504a490..85795b1e 100644 --- a/akode-rs/tui/src/terminal_hyperlinks.rs +++ b/akode-rs/tui/src/terminal_hyperlinks.rs @@ -933,8 +933,8 @@ pub(crate) fn mark_url_hyperlink(buf: &mut Buffer, area: Rect, destination: &str }); } -// Only the release-build update prompt and tests mark plain underlined links. -#[cfg(any(not(debug_assertions), test))] +// Only tests mark plain underlined links. +#[cfg(test)] pub(crate) fn mark_underlined_hyperlink(buf: &mut Buffer, area: Rect, destination: &str) { mark_matching_cells(buf, area, destination, |cell| { cell.modifier.contains(Modifier::UNDERLINED)