Tolti i link OpenAI dagli avvisi della TUI (B)
Da 03524f02: via i riferimenti a developers.openai.com / help.openai.com dagli avvisi
(sandbox, MCP, memorie, safety buffering, aggiornamenti).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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()),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(),
|
||||
]),
|
||||
});
|
||||
|
||||
@@ -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)),
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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::<Vec<_>>().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"));
|
||||
}
|
||||
|
||||
|
||||
@@ -147,23 +147,13 @@ pub(crate) struct SafetyAccessBlockCell {
|
||||
title: &'static str,
|
||||
pub(crate) explanation: Option<String>,
|
||||
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<Line<'static>> {
|
||||
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<HyperlinkLine> {
|
||||
|
||||
@@ -7,6 +7,3 @@ expression: rendered
|
||||
cybersecurity requests. Some
|
||||
cybersecurity requests are
|
||||
limited.
|
||||
Learn more: https://
|
||||
help.openai.com/en/
|
||||
articles/20001326
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user