mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Remove the custom MCP tool approval precedence test (#63604)
## What changed Remove the test that checked whether a tool-level approval setting overrides the MCP server default, an unconfigured tool uses the server default, and an unknown server falls back to `Auto`. GitOrigin-RevId: 68df73cbefe79772d75cdc35abe42d4de3cf991d
This commit is contained in:
@@ -2820,43 +2820,6 @@ async fn persist_custom_mcp_tool_approval_writes_tool_override() {
|
||||
assert!(contents.contains("[mcp_servers.docs.tools.search]"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn custom_mcp_tool_approval_mode_uses_server_default_with_tool_override() {
|
||||
let tmp = tempdir().expect("tempdir");
|
||||
std::fs::write(
|
||||
tmp.path().join(CONFIG_TOML_FILE),
|
||||
r#"
|
||||
[mcp_servers.docs]
|
||||
command = "docs-server"
|
||||
default_tools_approval_mode = "approve"
|
||||
|
||||
[mcp_servers.docs.tools.search]
|
||||
approval_mode = "prompt"
|
||||
"#,
|
||||
)
|
||||
.expect("seed config");
|
||||
let config = ConfigBuilder::default()
|
||||
.codex_home(tmp.path().to_path_buf())
|
||||
.build()
|
||||
.await
|
||||
.expect("load config");
|
||||
let (session, mut turn_context) = make_session_and_context().await;
|
||||
turn_context.config = Arc::new(config);
|
||||
|
||||
assert_eq!(
|
||||
custom_mcp_tool_approval_mode(&session, &turn_context, "docs", "read").await,
|
||||
AppToolApproval::Approve
|
||||
);
|
||||
assert_eq!(
|
||||
custom_mcp_tool_approval_mode(&session, &turn_context, "docs", "search").await,
|
||||
AppToolApproval::Prompt
|
||||
);
|
||||
assert_eq!(
|
||||
custom_mcp_tool_approval_mode(&session, &turn_context, "unknown", "search").await,
|
||||
AppToolApproval::Auto
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn custom_mcp_tool_approval_mode_uses_plugin_mcp_policy() {
|
||||
let (session, mut turn_context) = make_session_and_context().await;
|
||||
|
||||
Reference in New Issue
Block a user