Tolti i link alla documentazione OpenAI dai messaggi (B)

Parte "sicurezza" di 9636b74c e 83959bcc (senza protezione dai loop ne' grafo del codice):
- via i riferimenti a developers.openai.com da avvisi dei feature flag, profili, bubblewrap,
  memorie, MCP e sandbox di Windows (i link non sono sostituiti da altri);
- firma del baseline git: aKode <akode@localhost> invece di noreply@openai.com;
- test dei soli link rimossi (conservazione dell'hyperlink della documentazione MCP e Windows)
  eliminati con il codice che verificavano; altri test di messaggi adattati.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-17 12:50:15 +01:00
parent a354f0f00c
commit 8147e89f28
12 changed files with 10 additions and 134 deletions

View File

@@ -33,7 +33,6 @@ use super::popup_consts::MAX_POPUP_ROWS;
use super::scroll_state::ScrollState;
use super::selection_popup_common::GenericDisplayRow;
const MEMORIES_DOC_URL: &str = "https://developers.openai.com/codex/memories";
#[derive(Clone, Copy, PartialEq, Eq)]
enum MemoriesSetting {
@@ -101,12 +100,7 @@ impl MemoriesSettingsView {
reset_confirmation: None,
complete: false,
app_event_tx,
docs_link: Line::from(vec![
"Learn more: ".dim(),
MEMORIES_DOC_URL
.fg(crate::style::accent_color())
.underlined(),
]),
docs_link: Line::default(),
keymap,
};
view.initialize_selection();
@@ -414,7 +408,6 @@ impl Renderable for MemoriesSettingsView {
/*top*/ 0, /*left*/ 2, /*bottom*/ 0, /*right*/ 2,
));
self.docs_link.clone().render(docs_area, buf);
crate::terminal_hyperlinks::mark_url_hyperlink(buf, docs_area, MEMORIES_DOC_URL);
}
let hint_area = Rect {

View File

@@ -166,7 +166,6 @@ use tracing::warn;
const DEFAULT_MODEL_DISPLAY_NAME: &str = "loading";
const MEMORIES_ENABLE_NOTICE: &str = "Memories will be enabled in the next session.";
const MEMORIES_DOC_URL: &str = "https://developers.openai.com/codex/memories";
const PLAN_MODE_REASONING_SCOPE_TITLE: &str = "Apply reasoning change";
const PLAN_MODE_REASONING_SCOPE_PLAN_ONLY: &str = "Apply to Plan mode override";
const PLAN_MODE_REASONING_SCOPE_ALL_MODES: &str = "Apply to global default and Plan mode override";
@@ -1015,12 +1014,7 @@ impl ChatWidget {
self.bottom_pane.show_selection_view(SelectionViewParams {
title: Some(format!("Enable {name}?")),
subtitle: Some(format!("{label} are disabled in this TUI session.")),
footer_note: (feature == Feature::MemoryTool).then(|| {
Line::from(vec![
"Learn more: ".dim(),
MEMORIES_DOC_URL.cyan().underlined(),
])
}),
footer_note: None,
footer_hint: Some(standard_popup_hint_line()),
items: vec![
SelectionItem {

View File

@@ -1004,49 +1004,6 @@ async fn startup_windows_sandbox_prompt_blocks_disallowed_unelevated_fallback()
);
}
#[tokio::test]
async fn windows_sandbox_help_links_keep_complete_wrapped_destinations() {
let url = "https://developers.openai.com/codex/windows";
for fallback in [false, true] {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
let preset = builtin_approval_presets()
.into_iter()
.find(|preset| preset.id == "auto")
.unwrap();
if fallback {
chat.open_windows_sandbox_fallback_prompt(preset, /*profile_selection*/ None);
} else {
chat.open_windows_sandbox_enable_prompt(preset, /*profile_selection*/ None);
}
let area = Rect::new(0, 0, 40, 24);
let mut buf = Buffer::empty(area);
chat.bottom_pane.render(area, &mut buf);
let linked = buf
.content
.iter()
.filter(|cell| cell.symbol().contains("\x1b]8;;"))
.map(|cell| {
assert!(cell.symbol().starts_with(&format!("\x1b]8;;{url}\x07")));
crate::terminal_hyperlinks::strip_osc8(cell.symbol())
})
.collect::<String>();
assert_eq!(linked, url);
if !fallback {
let visible = buf
.content
.chunks(40)
.map(|row| {
row.iter()
.map(|cell| crate::terminal_hyperlinks::strip_osc8(cell.symbol()))
.collect::<String>()
})
.collect::<Vec<_>>()
.join("\n");
insta::assert_snapshot!("windows_sandbox_wrapped_help_url", visible);
}
}
}
#[tokio::test]
async fn windows_sandbox_required_enable_prompt_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;

View File

@@ -35,12 +35,11 @@ impl ChatWidget {
header.push(*Box::new(
crate::terminal_hyperlinks::HyperlinkText::new(if allow_unelevated {
vec![
line!["Set up the aKode agent sandbox to protect your files and control network access. Learn more <https://developers.openai.com/codex/windows>"],
line!["Set up the aKode agent sandbox to protect your files and control network access."],
]
} else {
vec![
line!["Your organization requires the default aKode agent sandbox to continue. Set it up to protect your files and control network access."],
line!["Learn more <https://developers.openai.com/codex/windows>"],
]
}),
));
@@ -164,9 +163,6 @@ impl ChatWidget {
"Your organization requires the default sandbox before aKode can continue."
]);
}
lines.push(line![
"Learn more <https://developers.openai.com/codex/windows>"
]);
let mut header = ColumnRenderable::new();
header.push(crate::terminal_hyperlinks::HyperlinkText::new(lines));

View File

@@ -439,12 +439,7 @@ pub(crate) fn new_active_mcp_tool_call(
}
/// Render a summary of configured MCP servers from the current `Config`.
pub(crate) fn empty_mcp_output() -> WebHyperlinkHistoryCell {
let mut docs_line = HyperlinkLine::new(Line::from(" See the "));
docs_line.push_span(
"MCP docs".underlined(),
Some("https://developers.openai.com/codex/mcp"),
);
docs_line.push_span(" to configure them.".into(), /*destination*/ None);
let docs_line = HyperlinkLine::new(Line::from(" Add one under [mcp_servers] in config.toml."));
let lines = vec![
HyperlinkLine::new("/mcp".magenta().into()),

View File

@@ -422,57 +422,6 @@ fn composite_cell_preserves_child_web_links() {
);
}
#[test]
fn empty_mcp_output_preserves_docs_hyperlink() {
let destination = "https://developers.openai.com/codex/mcp";
let cell: Box<dyn HistoryCell> = Box::new(empty_mcp_output());
insta::assert_snapshot!(render_lines(&cell.display_lines(/*width*/ 80)).join("\n"), @r"
/mcp
🔌 MCP Tools
• No MCP servers configured.
See the MCP docs to configure them.
");
let expected_link = vec![crate::terminal_hyperlinks::TerminalHyperlink::web(
/*columns*/ 12..20,
destination.to_string(),
)];
assert_eq!(
cell.display_hyperlink_lines(/*width*/ 80)[5].hyperlinks,
expected_link
);
assert_eq!(
cell.transcript_hyperlink_lines(/*width*/ 80)[5].hyperlinks,
expected_link
);
let area = Rect::new(0, 0, 80, 6);
let mut buf = Buffer::empty(area);
cell.render(area, &mut buf);
assert_eq!(
(0..39).map(|x| buf[(x, 5)].modifier).collect::<Vec<_>>(),
[
vec![Modifier::DIM; 12],
vec![Modifier::DIM | Modifier::UNDERLINED; 8],
vec![Modifier::DIM; 19],
]
.concat()
);
let linked_text = area
.positions()
.filter_map(|position| {
let symbol = buf[position].symbol();
symbol
.contains(&format!("\x1b]8;;{destination}\x07"))
.then(|| crate::terminal_hyperlinks::strip_osc8(symbol))
})
.collect::<String>();
assert_eq!(linked_text, "MCP docs");
}
#[test]
fn proposed_plan_cell_unwraps_markdown_fenced_table() {
let plan = new_proposed_plan(