mirror of
https://github.com/openai/codex.git
synced 2026-09-04 15:08:45 +00:00
Exclude synthetic app links from approval metadata
This commit is contained in:
@@ -1498,7 +1498,13 @@ fn connector_link_id_for_server(
|
||||
server: &str,
|
||||
meta: Option<&serde_json::Map<String, serde_json::Value>>,
|
||||
) -> Option<String> {
|
||||
if server != CODEX_APPS_MCP_SERVER_NAME {
|
||||
if server != CODEX_APPS_MCP_SERVER_NAME
|
||||
|| meta
|
||||
.and_then(|meta| meta.get(MCP_TOOL_CODEX_APPS_META_KEY))
|
||||
.and_then(|codex_apps_meta| codex_apps_meta.get("synthetic_link"))
|
||||
.and_then(serde_json::Value::as_bool)
|
||||
== Some(true)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
|
||||
@@ -369,6 +369,17 @@ fn connector_link_id_is_only_honored_for_codex_apps() {
|
||||
Some("link_123".to_string())
|
||||
);
|
||||
assert_eq!(connector_link_id_for_server("custom_server", meta), None);
|
||||
|
||||
let synthetic_link_meta = serde_json::json!({
|
||||
MCP_TOOL_APPROVAL_LINK_ID_KEY: "synthetic_link::calendar",
|
||||
MCP_TOOL_CODEX_APPS_META_KEY: {
|
||||
"synthetic_link": true,
|
||||
},
|
||||
});
|
||||
assert_eq!(
|
||||
connector_link_id_for_server(CODEX_APPS_MCP_SERVER_NAME, synthetic_link_meta.as_object()),
|
||||
None
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user