mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
Reduce diff
This commit is contained in:
@@ -1432,7 +1432,6 @@ pub(crate) fn new_mcp_tools_output(
|
||||
if tools.is_empty() {
|
||||
lines.push(" • No MCP tools available.".italic().into());
|
||||
lines.push("".into());
|
||||
return PlainHistoryCell { lines };
|
||||
}
|
||||
|
||||
let mut servers: Vec<_> = config.mcp_servers.iter().collect();
|
||||
@@ -1456,6 +1455,9 @@ pub(crate) fn new_mcp_tools_output(
|
||||
header.push(" ".into());
|
||||
header.push("(disabled)".red());
|
||||
lines.push(header.into());
|
||||
if let Some(reason) = cfg.disabled_reason.as_ref().map(ToString::to_string) {
|
||||
lines.push(vec![" • Reason: ".into(), reason.dim()].into());
|
||||
}
|
||||
lines.push(Line::from(""));
|
||||
continue;
|
||||
}
|
||||
@@ -1916,6 +1918,7 @@ mod tests {
|
||||
cwd: None,
|
||||
},
|
||||
enabled: true,
|
||||
disabled_reason: None,
|
||||
startup_timeout_sec: None,
|
||||
tool_timeout_sec: None,
|
||||
enabled_tools: None,
|
||||
@@ -1936,6 +1939,7 @@ mod tests {
|
||||
env_http_headers: Some(env_headers),
|
||||
},
|
||||
enabled: true,
|
||||
disabled_reason: None,
|
||||
startup_timeout_sec: None,
|
||||
tool_timeout_sec: None,
|
||||
enabled_tools: None,
|
||||
|
||||
@@ -1496,7 +1496,6 @@ pub(crate) fn new_mcp_tools_output(
|
||||
if tools.is_empty() {
|
||||
lines.push(" • No MCP tools available.".italic().into());
|
||||
lines.push("".into());
|
||||
return PlainHistoryCell { lines };
|
||||
}
|
||||
|
||||
let mut servers: Vec<_> = config.mcp_servers.iter().collect();
|
||||
@@ -1520,6 +1519,9 @@ pub(crate) fn new_mcp_tools_output(
|
||||
header.push(" ".into());
|
||||
header.push("(disabled)".red());
|
||||
lines.push(header.into());
|
||||
if let Some(reason) = cfg.disabled_reason.as_ref().map(ToString::to_string) {
|
||||
lines.push(vec![" • Reason: ".into(), reason.dim()].into());
|
||||
}
|
||||
lines.push(Line::from(""));
|
||||
continue;
|
||||
}
|
||||
@@ -2051,6 +2053,7 @@ mod tests {
|
||||
cwd: None,
|
||||
},
|
||||
enabled: true,
|
||||
disabled_reason: None,
|
||||
startup_timeout_sec: None,
|
||||
tool_timeout_sec: None,
|
||||
enabled_tools: None,
|
||||
@@ -2071,6 +2074,7 @@ mod tests {
|
||||
env_http_headers: Some(env_headers),
|
||||
},
|
||||
enabled: true,
|
||||
disabled_reason: None,
|
||||
startup_timeout_sec: None,
|
||||
tool_timeout_sec: None,
|
||||
enabled_tools: None,
|
||||
|
||||
Reference in New Issue
Block a user