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

@@ -133,8 +133,6 @@ async fn first_layer_config_error_from_entries(layers: &[ConfigLayerEntry]) -> O
/// ///
/// (*) Only available on macOS via managed device profiles. /// (*) Only available on macOS via managed device profiles.
/// ///
/// See https://developers.openai.com/codex/security for details.
///
/// When loading the config stack for a thread, there should be a `cwd` /// When loading the config stack for a thread, there should be a `cwd`
/// associated with it such that `cwd` should be `Some(...)`. Only for /// associated with it such that `cwd` should be `Some(...)`. Only for
/// thread-agnostic config loading (e.g., for the app server's `/config` /// thread-agnostic config loading (e.g., for the app server's `/config`
@@ -286,7 +284,7 @@ pub async fn load_config_layers_state(
return Err(io::Error::new( return Err(io::Error::new(
io::ErrorKind::InvalidData, io::ErrorKind::InvalidData,
format!( format!(
"--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \"{active_user_profile}\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table. See https://developers.openai.com/codex/config-advanced#profiles for more information.", "--profile `{active_user_profile}` cannot be used while {} contains legacy `profile = \"{active_user_profile}\"` or `[profiles.{active_user_profile}]` config; move those settings into {} and remove the legacy profile selector/table.",
base_user_file.as_path().display(), base_user_file.as_path().display(),
active_user_file.as_path().display() active_user_file.as_path().display()
), ),

View File

@@ -897,10 +897,6 @@ model = "gpt-work"
message.contains("[profiles.work]"), message.contains("[profiles.work]"),
"unexpected error message: {message}" "unexpected error message: {message}"
); );
assert!(
message.contains("https://developers.openai.com/codex/config-advanced#profiles"),
"unexpected error message: {message}"
);
} }
#[tokio::test] #[tokio::test]

View File

@@ -46,7 +46,7 @@ async fn emits_deprecation_notice_for_legacy_feature_flag() -> anyhow::Result<()
assert_eq!( assert_eq!(
details.as_deref(), details.as_deref(),
Some( Some(
"Enable it with `--enable unified_exec` or `[features].unified_exec` in config.toml. See https://developers.openai.com/codex/config-basic#feature-flags for details." "Enable it with `--enable unified_exec` or `[features].unified_exec` in config.toml."
), ),
); );

View File

@@ -908,7 +908,7 @@ fn legacy_usage_notice(alias: &str, feature: Feature) -> (String, Option<String>
None None
} else { } else {
Some(format!( Some(format!(
"Enable it with `--enable {canonical}` or `[features].{canonical}` in config.toml. See https://developers.openai.com/codex/config-basic#feature-flags for details." "Enable it with `--enable {canonical}` or `[features].{canonical}` in config.toml."
)) ))
}; };
(summary, details) (summary, details)

View File

@@ -24,7 +24,7 @@ const BASELINE_VERSION_FILE: &str = "codex-baseline-version";
const BASELINE_VERSION: &[u8] = b"1\n"; const BASELINE_VERSION: &[u8] = b"1\n";
const BASELINE_COMMIT_MESSAGE: &str = const BASELINE_COMMIT_MESSAGE: &str =
"Initialize Codex git baseline\n\nCo-authored-by: Codex <noreply@openai.com>"; "Initialize aKode git baseline\n\nCo-authored-by: aKode <akode@localhost>";
/// File-level change status between a git baseline and the current directory. /// File-level change status between a git baseline and the current directory.
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -256,8 +256,8 @@ pub async fn diff_since_latest_init(root: &Path) -> anyhow::Result<GitBaselineDi
fn codex_signature() -> gix::actor::Signature { fn codex_signature() -> gix::actor::Signature {
gix::actor::Signature { gix::actor::Signature {
name: "Codex".into(), name: "aKode".into(),
email: "noreply@openai.com".into(), email: "akode@localhost".into(),
time: gix::date::Time { time: gix::date::Time {
seconds: chrono::Utc::now().timestamp(), seconds: chrono::Utc::now().timestamp(),
offset: 0, offset: 0,

View File

@@ -21,8 +21,6 @@ const SYSTEM_BWRAP_PROGRAM: &str = "bwrap";
const MISSING_BWRAP_WARNING: &str = concat!( const MISSING_BWRAP_WARNING: &str = concat!(
"Codex could not find bubblewrap on PATH. ", "Codex could not find bubblewrap on PATH. ",
"Install bubblewrap with your OS package manager. ", "Install bubblewrap with your OS package manager. ",
"See the sandbox prerequisites: ",
"https://developers.openai.com/codex/concepts/sandboxing#prerequisites. ",
"Codex will use the bundled bubblewrap in the meantime.", "Codex will use the bundled bubblewrap in the meantime.",
); );
const USER_NAMESPACE_WARNING: &str = const USER_NAMESPACE_WARNING: &str =

View File

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

View File

@@ -166,7 +166,6 @@ use tracing::warn;
const DEFAULT_MODEL_DISPLAY_NAME: &str = "loading"; const DEFAULT_MODEL_DISPLAY_NAME: &str = "loading";
const MEMORIES_ENABLE_NOTICE: &str = "Memories will be enabled in the next session."; 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_TITLE: &str = "Apply reasoning change";
const PLAN_MODE_REASONING_SCOPE_PLAN_ONLY: &str = "Apply to Plan mode override"; 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"; 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 { self.bottom_pane.show_selection_view(SelectionViewParams {
title: Some(format!("Enable {name}?")), title: Some(format!("Enable {name}?")),
subtitle: Some(format!("{label} are disabled in this TUI session.")), subtitle: Some(format!("{label} are disabled in this TUI session.")),
footer_note: (feature == Feature::MemoryTool).then(|| { footer_note: None,
Line::from(vec![
"Learn more: ".dim(),
MEMORIES_DOC_URL.cyan().underlined(),
])
}),
footer_hint: Some(standard_popup_hint_line()), footer_hint: Some(standard_popup_hint_line()),
items: vec![ items: vec![
SelectionItem { 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] #[tokio::test]
async fn windows_sandbox_required_enable_prompt_snapshot() { async fn windows_sandbox_required_enable_prompt_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await; 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( header.push(*Box::new(
crate::terminal_hyperlinks::HyperlinkText::new(if allow_unelevated { crate::terminal_hyperlinks::HyperlinkText::new(if allow_unelevated {
vec![ 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 { } else {
vec![ vec![
line!["Your organization requires the default aKode agent sandbox to continue. Set it up to protect your files and control network access."], 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." "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(); let mut header = ColumnRenderable::new();
header.push(crate::terminal_hyperlinks::HyperlinkText::new(lines)); 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`. /// Render a summary of configured MCP servers from the current `Config`.
pub(crate) fn empty_mcp_output() -> WebHyperlinkHistoryCell { pub(crate) fn empty_mcp_output() -> WebHyperlinkHistoryCell {
let mut docs_line = HyperlinkLine::new(Line::from(" See the ")); let docs_line = HyperlinkLine::new(Line::from(" Add one under [mcp_servers] in config.toml."));
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 lines = vec![ let lines = vec![
HyperlinkLine::new("/mcp".magenta().into()), 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] #[test]
fn proposed_plan_cell_unwraps_markdown_fenced_table() { fn proposed_plan_cell_unwraps_markdown_fenced_table() {
let plan = new_proposed_plan( let plan = new_proposed_plan(