Remove Codex Apps prompt residue
This commit is contained in:
parent
9d40972195
commit
b84acf78b1
18 changed files with 78 additions and 125 deletions
|
|
@ -939,6 +939,14 @@ plus generated config schema entries were removed. A vendored-wide search for
|
|||
product-shaped skill markers now returns nothing; only the ordinary English word
|
||||
"skill" remains in personality copy.
|
||||
|
||||
The app-instruction compatibility stump is cut too. `APPS_INSTRUCTIONS` protocol
|
||||
constants and `<apps_instructions>` snapshot canonicalization/tests are gone.
|
||||
MCP tests that previously used `codex_apps`, `_codex_apps`, `mcp__codex_apps`,
|
||||
or `/api/codex/apps` as fixture branding were renamed to neutral demo/calendar
|
||||
MCP names. MCP itself remains valid JSON-RPC protocol edge machinery; the cut is
|
||||
only the deleted Codex Apps product identity leaking into tests and prompt
|
||||
snapshots.
|
||||
|
||||
That husk has now been cut from `codex-core`. The root core crate no longer
|
||||
exports `plugins`, no longer depends on `codex-core-plugins` or `codex-plugin`,
|
||||
and the core plugin manager / marketplace add-remove-sync modules and tests
|
||||
|
|
|
|||
Binary file not shown.
File diff suppressed because one or more lines are too long
|
|
@ -1424,7 +1424,7 @@ mod tests {
|
|||
let params = v2::McpServerElicitationRequestParams {
|
||||
thread_id: "thr_123".to_string(),
|
||||
turn_id: Some("turn_123".to_string()),
|
||||
server_name: "codex_apps".to_string(),
|
||||
server_name: "demo_mcp".to_string(),
|
||||
request: v2::McpServerElicitationRequest::Form {
|
||||
meta: None,
|
||||
message: "Allow this request?".to_string(),
|
||||
|
|
@ -1443,7 +1443,7 @@ mod tests {
|
|||
"params": {
|
||||
"threadId": "thr_123",
|
||||
"turnId": "turn_123",
|
||||
"serverName": "codex_apps",
|
||||
"serverName": "demo_mcp",
|
||||
"mode": "form",
|
||||
"_meta": null,
|
||||
"message": "Allow this request?",
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ stream_max_retries = 0
|
|||
let read_request_id = mcp
|
||||
.send_mcp_resource_read_request(McpResourceReadParams {
|
||||
thread_id: Some(thread.id),
|
||||
server: "codex_apps".to_string(),
|
||||
server: "demo_mcp".to_string(),
|
||||
uri: TEST_RESOURCE_URI.to_string(),
|
||||
})
|
||||
.await?;
|
||||
|
|
@ -163,7 +163,7 @@ apps = true
|
|||
let read_request_id = mcp
|
||||
.send_mcp_resource_read_request(McpResourceReadParams {
|
||||
thread_id: None,
|
||||
server: "codex_apps".to_string(),
|
||||
server: "demo_mcp".to_string(),
|
||||
uri: TEST_RESOURCE_URI.to_string(),
|
||||
})
|
||||
.await?;
|
||||
|
|
@ -225,7 +225,7 @@ async fn mcp_resource_read_returns_error_for_unknown_thread() -> Result<()> {
|
|||
request_id: RequestId::Integer(1),
|
||||
params: McpResourceReadParams {
|
||||
thread_id: Some("00000000-0000-4000-8000-000000000000".to_string()),
|
||||
server: "codex_apps".to_string(),
|
||||
server: "demo_mcp".to_string(),
|
||||
uri: TEST_RESOURCE_URI.to_string(),
|
||||
},
|
||||
})
|
||||
|
|
@ -254,7 +254,7 @@ async fn start_resource_apps_mcp_server() -> Result<(String, JoinHandle<()>)> {
|
|||
Arc::new(LocalSessionManager::default()),
|
||||
StreamableHttpServerConfig::default(),
|
||||
);
|
||||
let router = Router::new().nest_service("/api/codex/apps", mcp_service);
|
||||
let router = Router::new().nest_service("/api/mcp/demo", mcp_service);
|
||||
let apps_server_handle = tokio::spawn(async move {
|
||||
let _ = axum::serve(listener, router).await;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ use tokio::time::timeout;
|
|||
const DEFAULT_READ_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(10);
|
||||
const CONNECTOR_ID: &str = "calendar";
|
||||
const CONNECTOR_NAME: &str = "Calendar";
|
||||
const TOOL_NAMESPACE: &str = "mcp__codex_apps__calendar";
|
||||
const TOOL_NAMESPACE: &str = "mcp__calendar_mcp__calendar";
|
||||
const CALLABLE_TOOL_NAME: &str = "_confirm_action";
|
||||
const TOOL_NAME: &str = "calendar_confirm_action";
|
||||
const TOOL_CALL_ID: &str = "call-calendar-confirm";
|
||||
|
|
@ -202,7 +202,7 @@ async fn mcp_server_elicitation_round_trip() -> Result<()> {
|
|||
McpServerElicitationRequestParams {
|
||||
thread_id: thread.id.clone(),
|
||||
turn_id: Some(turn.id.clone()),
|
||||
server_name: "codex_apps".to_string(),
|
||||
server_name: "demo_mcp".to_string(),
|
||||
request: McpServerElicitationRequest::Form {
|
||||
meta: None,
|
||||
message: ELICITATION_MESSAGE.to_string(),
|
||||
|
|
@ -407,7 +407,7 @@ async fn start_apps_server() -> Result<(String, JoinHandle<()>)> {
|
|||
get(list_directory_connectors),
|
||||
)
|
||||
.with_state(state)
|
||||
.nest_service("/api/codex/apps", mcp_service);
|
||||
.nest_service("/api/mcp/demo", mcp_service);
|
||||
|
||||
let handle = tokio::spawn(async move {
|
||||
let _ = axum::serve(listener, router).await;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ impl ToolHandler for TestHandler {
|
|||
fn handler_looks_up_namespaced_aliases_explicitly() {
|
||||
let plain_handler = Arc::new(TestHandler) as Arc<dyn AnyToolHandler>;
|
||||
let namespaced_handler = Arc::new(TestHandler) as Arc<dyn AnyToolHandler>;
|
||||
let namespace = "mcp__codex_apps__gmail";
|
||||
let namespace = "mcp__mail_mcp__gmail";
|
||||
let tool_name = "gmail_get_recent_emails";
|
||||
let plain_name = codex_tools::ToolName::plain(tool_name);
|
||||
let namespaced_name = codex_tools::ToolName::namespaced(namespace, tool_name);
|
||||
|
|
@ -31,7 +31,7 @@ fn handler_looks_up_namespaced_aliases_explicitly() {
|
|||
let plain = registry.handler(&plain_name);
|
||||
let namespaced = registry.handler(&namespaced_name);
|
||||
let missing_namespaced = registry.handler(&codex_tools::ToolName::namespaced(
|
||||
"mcp__codex_apps__calendar",
|
||||
"mcp__calendar_mcp__calendar",
|
||||
tool_name,
|
||||
));
|
||||
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ async fn build_tool_call_uses_namespace_for_registry_name() -> anyhow::Result<()
|
|||
ResponseItem::FunctionCall {
|
||||
id: None,
|
||||
name: tool_name.clone(),
|
||||
namespace: Some("mcp__codex_apps__calendar".to_string()),
|
||||
namespace: Some("mcp__calendar_mcp__calendar".to_string()),
|
||||
arguments: "{}".to_string(),
|
||||
call_id: "call-namespace".to_string(),
|
||||
},
|
||||
|
|
@ -249,7 +249,7 @@ async fn build_tool_call_uses_namespace_for_registry_name() -> anyhow::Result<()
|
|||
|
||||
assert_eq!(
|
||||
call.tool_name,
|
||||
ToolName::namespaced("mcp__codex_apps__calendar", tool_name)
|
||||
ToolName::namespaced("mcp__calendar_mcp__calendar", tool_name)
|
||||
);
|
||||
assert_eq!(call.call_id, "call-namespace");
|
||||
match call.payload {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ fn deferred_responses_api_tool_serializes_with_defer_loading() {
|
|||
|
||||
let serialized = serde_json::to_value(ToolSpec::Function(
|
||||
mcp_tool_to_deferred_responses_api_tool(
|
||||
&ToolName::namespaced("mcp__codex_apps__", "lookup_order"),
|
||||
&ToolName::namespaced("mcp__demo_mcp__", "lookup_order"),
|
||||
&tool,
|
||||
)
|
||||
.expect("convert deferred tool"),
|
||||
|
|
@ -808,11 +808,11 @@ async fn search_tool_description_falls_back_to_connector_name_without_descriptio
|
|||
&tools_config,
|
||||
/*mcp_tools*/ None,
|
||||
Some(HashMap::from([(
|
||||
"mcp__codex_apps__calendar_create_event".to_string(),
|
||||
"mcp__calendar_mcp__calendar_create_event".to_string(),
|
||||
ToolInfo {
|
||||
server_name: "codex_apps".to_string(),
|
||||
server_name: "demo_mcp".to_string(),
|
||||
callable_name: "_create_event".to_string(),
|
||||
callable_namespace: "mcp__codex_apps__calendar".to_string(),
|
||||
callable_namespace: "mcp__calendar_mcp__calendar".to_string(),
|
||||
server_instructions: None,
|
||||
tool: mcp_tool(
|
||||
"calendar_create_event",
|
||||
|
|
@ -858,11 +858,11 @@ async fn search_tool_registers_namespaced_mcp_tool_aliases() {
|
|||
/*mcp_tools*/ None,
|
||||
Some(HashMap::from([
|
||||
(
|
||||
"mcp__codex_apps__calendar_create_event".to_string(),
|
||||
"mcp__calendar_mcp__calendar_create_event".to_string(),
|
||||
ToolInfo {
|
||||
server_name: "codex_apps".to_string(),
|
||||
server_name: "demo_mcp".to_string(),
|
||||
callable_name: "_create_event".to_string(),
|
||||
callable_namespace: "mcp__codex_apps__calendar".to_string(),
|
||||
callable_namespace: "mcp__calendar_mcp__calendar".to_string(),
|
||||
server_instructions: None,
|
||||
tool: mcp_tool(
|
||||
"calendar-create-event",
|
||||
|
|
@ -875,11 +875,11 @@ async fn search_tool_registers_namespaced_mcp_tool_aliases() {
|
|||
},
|
||||
),
|
||||
(
|
||||
"mcp__codex_apps__calendar_list_events".to_string(),
|
||||
"mcp__calendar_mcp__calendar_list_events".to_string(),
|
||||
ToolInfo {
|
||||
server_name: "codex_apps".to_string(),
|
||||
server_name: "demo_mcp".to_string(),
|
||||
callable_name: "_list_events".to_string(),
|
||||
callable_namespace: "mcp__codex_apps__calendar".to_string(),
|
||||
callable_namespace: "mcp__calendar_mcp__calendar".to_string(),
|
||||
server_instructions: None,
|
||||
tool: mcp_tool(
|
||||
"calendar-list-events",
|
||||
|
|
@ -909,7 +909,7 @@ async fn search_tool_registers_namespaced_mcp_tool_aliases() {
|
|||
)
|
||||
.build();
|
||||
|
||||
let app_alias = ToolName::namespaced("mcp__codex_apps__calendar", "_create_event");
|
||||
let app_alias = ToolName::namespaced("mcp__calendar_mcp__calendar", "_create_event");
|
||||
let mcp_alias = ToolName::namespaced("mcp__rmcp__", "echo");
|
||||
|
||||
assert!(registry.has_handler(&ToolName::plain(TOOL_SEARCH_TOOL_NAME)));
|
||||
|
|
@ -972,7 +972,7 @@ async fn unavailable_mcp_tools_are_exposed_as_dummy_function_tools() {
|
|||
windows_sandbox_level: WindowsSandboxLevel::Disabled,
|
||||
});
|
||||
|
||||
let unavailable_tool = ToolName::namespaced("mcp__codex_apps__calendar", "_create_event");
|
||||
let unavailable_tool = ToolName::namespaced("mcp__calendar_mcp__calendar", "_create_event");
|
||||
let (tools, registry) = build_specs_with_unavailable_tools(
|
||||
&tools_config,
|
||||
/*mcp_tools*/ None,
|
||||
|
|
@ -982,7 +982,7 @@ async fn unavailable_mcp_tools_are_exposed_as_dummy_function_tools() {
|
|||
)
|
||||
.build();
|
||||
|
||||
let tool = find_tool(&tools, "mcp__codex_apps__calendar_create_event");
|
||||
let tool = find_tool(&tools, "mcp__calendar_mcp__calendar_create_event");
|
||||
let ToolSpec::Function(ResponsesApiTool {
|
||||
description,
|
||||
parameters,
|
||||
|
|
@ -997,10 +997,10 @@ async fn unavailable_mcp_tools_are_exposed_as_dummy_function_tools() {
|
|||
Some(AdditionalProperties::Boolean(false))
|
||||
);
|
||||
assert!(registry.has_handler(&ToolName::namespaced(
|
||||
"mcp__codex_apps__calendar",
|
||||
"mcp__calendar_mcp__calendar",
|
||||
"_create_event"
|
||||
)));
|
||||
assert!(!registry.has_handler(&ToolName::plain("mcp__codex_apps__calendar_create_event")));
|
||||
assert!(!registry.has_handler(&ToolName::plain("mcp__calendar_mcp__calendar_create_event")));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ mod tests {
|
|||
let input = vec![
|
||||
function_call("shell", /*namespace*/ None),
|
||||
function_call("mcp__server__lookup", /*namespace*/ None),
|
||||
function_call("_create_event", Some("mcp__codex_apps__calendar")),
|
||||
function_call("_create_event", Some("mcp__calendar_mcp__calendar")),
|
||||
];
|
||||
|
||||
let tools = collect_unavailable_called_tools(&input, &HashSet::new());
|
||||
|
|
@ -70,7 +70,7 @@ mod tests {
|
|||
assert_eq!(
|
||||
tools,
|
||||
vec![
|
||||
ToolName::namespaced("mcp__codex_apps__calendar", "_create_event"),
|
||||
ToolName::namespaced("mcp__calendar_mcp__calendar", "_create_event"),
|
||||
ToolName::plain("mcp__server__lookup"),
|
||||
]
|
||||
);
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ async fn mount_streamable_http_json_rpc(
|
|||
searchable: bool,
|
||||
) {
|
||||
Mock::given(method("POST"))
|
||||
.and(path_regex("^/api/codex/apps/?$"))
|
||||
.and(path_regex("^/api/mcp/demo/?$"))
|
||||
.respond_with(CodexAppsJsonRpcResponder {
|
||||
connector_name,
|
||||
connector_description,
|
||||
|
|
@ -209,7 +209,7 @@ impl Respond for CodexAppsJsonRpcResponder {
|
|||
"connector_name": self.connector_name.clone(),
|
||||
"connector_description": self.connector_description.clone(),
|
||||
"openai/outputTemplate": CALENDAR_CREATE_EVENT_MCP_APP_RESOURCE_URI,
|
||||
"_codex_apps": {
|
||||
"_mcp_bridge": {
|
||||
"resource_uri": CALENDAR_CREATE_EVENT_RESOURCE_URI,
|
||||
"contains_mcp_source": true,
|
||||
"connector_id": CONNECTOR_ID
|
||||
|
|
@ -234,7 +234,7 @@ impl Respond for CodexAppsJsonRpcResponder {
|
|||
"connector_id": CONNECTOR_ID,
|
||||
"connector_name": self.connector_name.clone(),
|
||||
"connector_description": self.connector_description.clone(),
|
||||
"_codex_apps": {
|
||||
"_mcp_bridge": {
|
||||
"resource_uri": CALENDAR_LIST_EVENTS_RESOURCE_URI,
|
||||
"contains_mcp_source": true,
|
||||
"connector_id": CONNECTOR_ID
|
||||
|
|
@ -267,7 +267,7 @@ impl Respond for CodexAppsJsonRpcResponder {
|
|||
"connector_name": self.connector_name.clone(),
|
||||
"connector_description": self.connector_description.clone(),
|
||||
"openai/fileParams": ["file"],
|
||||
"_codex_apps": {
|
||||
"_mcp_bridge": {
|
||||
"resource_uri": DOCUMENT_EXTRACT_TEXT_RESOURCE_URI,
|
||||
"contains_mcp_source": true,
|
||||
"connector_id": CONNECTOR_ID
|
||||
|
|
@ -325,7 +325,7 @@ impl Respond for CodexAppsJsonRpcResponder {
|
|||
.pointer("/params/arguments/file/file_id")
|
||||
.and_then(Value::as_str)
|
||||
.unwrap_or_default();
|
||||
let codex_apps_meta = body.pointer("/params/_meta/_codex_apps").cloned();
|
||||
let demo_mcp_meta = body.pointer("/params/_meta/_mcp_bridge").cloned();
|
||||
|
||||
ResponseTemplate::new(200).set_body_json(json!({
|
||||
"jsonrpc": "2.0",
|
||||
|
|
@ -336,7 +336,7 @@ impl Respond for CodexAppsJsonRpcResponder {
|
|||
"text": format!("called {tool_name} for {title} at {starts_at} with {file_id}")
|
||||
}],
|
||||
"structuredContent": {
|
||||
"_codex_apps": codex_apps_meta,
|
||||
"_mcp_bridge": demo_mcp_meta,
|
||||
},
|
||||
"isError": false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
use serde_json::Value;
|
||||
|
||||
use crate::responses::ResponsesRequest;
|
||||
use codex_protocol::protocol::APPS_INSTRUCTIONS_OPEN_TAG;
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
|
||||
pub enum ContextSnapshotRenderMode {
|
||||
|
|
@ -85,12 +84,6 @@ pub fn format_response_items_snapshot(items: &[Value], options: &ContextSnapshot
|
|||
.iter()
|
||||
.filter_map(|entry| {
|
||||
if let Some(text) = entry.get("text").and_then(Value::as_str) {
|
||||
if options.strip_capability_instructions
|
||||
&& role == "developer"
|
||||
&& is_capability_instruction_text(text)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
if options.strip_agents_md_user_context
|
||||
&& role == "user"
|
||||
&& text.starts_with("# AGENTS.md instructions for ")
|
||||
|
|
@ -268,9 +261,6 @@ fn canonicalize_snapshot_text(text: &str) -> String {
|
|||
if text.starts_with("<permissions instructions>") {
|
||||
return "<PERMISSIONS_INSTRUCTIONS>".to_string();
|
||||
}
|
||||
if text.starts_with(APPS_INSTRUCTIONS_OPEN_TAG) {
|
||||
return "<APPS_INSTRUCTIONS>".to_string();
|
||||
}
|
||||
if text.starts_with("# AGENTS.md instructions for ") {
|
||||
return "<AGENTS_MD>".to_string();
|
||||
}
|
||||
|
|
@ -315,10 +305,6 @@ fn canonicalize_snapshot_text(text: &str) -> String {
|
|||
text.to_string()
|
||||
}
|
||||
|
||||
fn is_capability_instruction_text(text: &str) -> bool {
|
||||
text.starts_with(APPS_INSTRUCTIONS_OPEN_TAG)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::ContextSnapshotOptions;
|
||||
|
|
@ -387,49 +373,6 @@ mod tests {
|
|||
assert_eq!(rendered, "00:message/user:<AGENTS_MD>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn redacted_text_mode_keeps_app_instruction_placeholder() {
|
||||
let items = vec![json!({
|
||||
"type": "message",
|
||||
"role": "developer",
|
||||
"content": [{
|
||||
"type": "input_text",
|
||||
"text": "<apps_instructions>\n## Apps\nbody\n</apps_instructions>"
|
||||
}]
|
||||
})];
|
||||
|
||||
let rendered = format_response_items_snapshot(
|
||||
&items,
|
||||
&ContextSnapshotOptions::default().render_mode(ContextSnapshotRenderMode::RedactedText),
|
||||
);
|
||||
|
||||
assert_eq!(
|
||||
rendered,
|
||||
"00:message/developer:<APPS_INSTRUCTIONS>"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn strip_capability_instructions_omits_capability_parts_from_developer_messages() {
|
||||
let items = vec![json!({
|
||||
"type": "message",
|
||||
"role": "developer",
|
||||
"content": [
|
||||
{ "type": "input_text", "text": "<permissions instructions>\n...</permissions instructions>" },
|
||||
{ "type": "input_text", "text": "<apps_instructions>\n## Apps\n...</apps_instructions>" }
|
||||
]
|
||||
})];
|
||||
|
||||
let rendered = format_response_items_snapshot(
|
||||
&items,
|
||||
&ContextSnapshotOptions::default()
|
||||
.render_mode(ContextSnapshotRenderMode::RedactedText)
|
||||
.strip_capability_instructions(),
|
||||
);
|
||||
|
||||
assert_eq!(rendered, "00:message/developer:<PERMISSIONS_INSTRUCTIONS>");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn strip_agents_md_user_context_omits_agents_fragment_from_user_messages() {
|
||||
let items = vec![json!({
|
||||
|
|
|
|||
|
|
@ -366,7 +366,7 @@ async fn code_mode_only_guides_all_tools_search_and_calls_deferred_app_tools() -
|
|||
"exec",
|
||||
r#"
|
||||
const tool = ALL_TOOLS.find(
|
||||
({ name }) => name === "mcp__codex_apps__calendar_timezone_option_99"
|
||||
({ name }) => name === "mcp__calendar_mcp__calendar_timezone_option_99"
|
||||
);
|
||||
if (!tool) {
|
||||
text(JSON.stringify({ found: false }));
|
||||
|
|
|
|||
|
|
@ -47,9 +47,9 @@ const SEARCH_TOOL_DESCRIPTION_SNIPPETS: [&str; 2] = [
|
|||
"- Calendar: Plan events and manage your calendar.",
|
||||
];
|
||||
const TOOL_SEARCH_TOOL_NAME: &str = "tool_search";
|
||||
const CALENDAR_CREATE_TOOL: &str = "mcp__codex_apps__calendar_create_event";
|
||||
const CALENDAR_LIST_TOOL: &str = "mcp__codex_apps__calendar_list_events";
|
||||
const SEARCH_CALENDAR_NAMESPACE: &str = "mcp__codex_apps__calendar";
|
||||
const CALENDAR_CREATE_TOOL: &str = "mcp__calendar_mcp__calendar_create_event";
|
||||
const CALENDAR_LIST_TOOL: &str = "mcp__calendar_mcp__calendar_list_events";
|
||||
const SEARCH_CALENDAR_NAMESPACE: &str = "mcp__calendar_mcp__calendar";
|
||||
const SEARCH_CALENDAR_CREATE_TOOL: &str = "_create_event";
|
||||
const SEARCH_CALENDAR_LIST_TOOL: &str = "_list_events";
|
||||
|
||||
|
|
@ -536,7 +536,7 @@ async fn tool_search_returns_deferred_tools_without_follow_up_tool_injection() -
|
|||
assert_eq!(
|
||||
end.invocation,
|
||||
McpInvocation {
|
||||
server: "codex_apps".to_string(),
|
||||
server: "demo_mcp".to_string(),
|
||||
tool: "calendar_create_event".to_string(),
|
||||
arguments: Some(json!({
|
||||
"title": "Lunch",
|
||||
|
|
@ -550,7 +550,7 @@ async fn tool_search_returns_deferred_tools_without_follow_up_tool_injection() -
|
|||
.expect("tool call should succeed")
|
||||
.structured_content,
|
||||
Some(json!({
|
||||
"_codex_apps": {
|
||||
"_mcp_bridge": {
|
||||
"resource_uri": CALENDAR_CREATE_EVENT_RESOURCE_URI,
|
||||
"contains_mcp_source": true,
|
||||
"connector_id": "calendar",
|
||||
|
|
@ -573,14 +573,14 @@ async fn tool_search_returns_deferred_tools_without_follow_up_tool_injection() -
|
|||
.into_iter()
|
||||
.find_map(|request| {
|
||||
let body: Value = serde_json::from_slice(&request.body).ok()?;
|
||||
(request.url.path() == "/api/codex/apps"
|
||||
(request.url.path() == "/api/mcp/demo"
|
||||
&& body.get("method").and_then(Value::as_str) == Some("tools/call"))
|
||||
.then_some(body)
|
||||
})
|
||||
.expect("apps tools/call request should be recorded");
|
||||
|
||||
assert_eq!(
|
||||
apps_tool_call.pointer("/params/_meta/_codex_apps"),
|
||||
apps_tool_call.pointer("/params/_meta/_mcp_bridge"),
|
||||
Some(&json!({
|
||||
"resource_uri": CALENDAR_CREATE_EVENT_RESOURCE_URI,
|
||||
"contains_mcp_source": true,
|
||||
|
|
|
|||
14
vendor/codex/codex-rs/protocol/src/models.rs
vendored
14
vendor/codex/codex-rs/protocol/src/models.rs
vendored
|
|
@ -1614,8 +1614,8 @@ mod tests {
|
|||
fn function_call_deserializes_optional_namespace() {
|
||||
let item: ResponseItem = serde_json::from_value(serde_json::json!({
|
||||
"type": "function_call",
|
||||
"name": "mcp__codex_apps__gmail_get_recent_emails",
|
||||
"namespace": "mcp__codex_apps__gmail",
|
||||
"name": "mcp__mail_mcp__gmail_get_recent_emails",
|
||||
"namespace": "mcp__mail_mcp__gmail",
|
||||
"arguments": "{\"top_k\":5}",
|
||||
"call_id": "call-1",
|
||||
}))
|
||||
|
|
@ -1625,8 +1625,8 @@ mod tests {
|
|||
item,
|
||||
ResponseItem::FunctionCall {
|
||||
id: None,
|
||||
name: "mcp__codex_apps__gmail_get_recent_emails".to_string(),
|
||||
namespace: Some("mcp__codex_apps__gmail".to_string()),
|
||||
name: "mcp__mail_mcp__gmail_get_recent_emails".to_string(),
|
||||
namespace: Some("mcp__mail_mcp__gmail".to_string()),
|
||||
arguments: "{\"top_k\":5}".to_string(),
|
||||
call_id: "call-1".to_string(),
|
||||
}
|
||||
|
|
@ -2122,7 +2122,7 @@ mod tests {
|
|||
execution: "client".to_string(),
|
||||
tools: vec![serde_json::json!({
|
||||
"type": "function",
|
||||
"name": "mcp__codex_apps__calendar_create_event",
|
||||
"name": "mcp__calendar_mcp__calendar_create_event",
|
||||
"description": "Create a calendar event.",
|
||||
"defer_loading": true,
|
||||
"parameters": {
|
||||
|
|
@ -2143,7 +2143,7 @@ mod tests {
|
|||
execution: "client".to_string(),
|
||||
tools: vec![serde_json::json!({
|
||||
"type": "function",
|
||||
"name": "mcp__codex_apps__calendar_create_event",
|
||||
"name": "mcp__calendar_mcp__calendar_create_event",
|
||||
"description": "Create a calendar event.",
|
||||
"defer_loading": true,
|
||||
"parameters": {
|
||||
|
|
@ -2167,7 +2167,7 @@ mod tests {
|
|||
"execution": "client",
|
||||
"tools": [{
|
||||
"type": "function",
|
||||
"name": "mcp__codex_apps__calendar_create_event",
|
||||
"name": "mcp__calendar_mcp__calendar_create_event",
|
||||
"description": "Create a calendar event.",
|
||||
"defer_loading": true,
|
||||
"parameters": {
|
||||
|
|
|
|||
|
|
@ -92,8 +92,6 @@ pub const USER_INSTRUCTIONS_OPEN_TAG: &str = "<user_instructions>";
|
|||
pub const USER_INSTRUCTIONS_CLOSE_TAG: &str = "</user_instructions>";
|
||||
pub const ENVIRONMENT_CONTEXT_OPEN_TAG: &str = "<environment_context>";
|
||||
pub const ENVIRONMENT_CONTEXT_CLOSE_TAG: &str = "</environment_context>";
|
||||
pub const APPS_INSTRUCTIONS_OPEN_TAG: &str = "<apps_instructions>";
|
||||
pub const APPS_INSTRUCTIONS_CLOSE_TAG: &str = "</apps_instructions>";
|
||||
pub const COLLABORATION_MODE_OPEN_TAG: &str = "<collaboration_mode>";
|
||||
pub const COLLABORATION_MODE_CLOSE_TAG: &str = "</collaboration_mode>";
|
||||
pub const EPIPHANY_STATE_OPEN_TAG: &str = "<epiphany_state>";
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ fn mcp_tool_to_deferred_responses_api_tool_sets_defer_loading() {
|
|||
|
||||
assert_eq!(
|
||||
mcp_tool_to_deferred_responses_api_tool(
|
||||
&ToolName::namespaced("mcp__codex_apps__", "lookup_order"),
|
||||
&ToolName::namespaced("mcp__demo_mcp__", "lookup_order"),
|
||||
&tool,
|
||||
)
|
||||
.expect("convert deferred tool"),
|
||||
|
|
@ -133,7 +133,7 @@ fn mcp_tool_to_deferred_responses_api_tool_sets_defer_loading() {
|
|||
#[test]
|
||||
fn loadable_tool_spec_namespace_serializes_with_deferred_child_tools() {
|
||||
let namespace = LoadableToolSpec::Namespace(ResponsesApiNamespace {
|
||||
name: "mcp__codex_apps__calendar".to_string(),
|
||||
name: "mcp__calendar_mcp__calendar".to_string(),
|
||||
description: "Plan events".to_string(),
|
||||
tools: vec![ResponsesApiNamespaceTool::Function(ResponsesApiTool {
|
||||
name: "create_event".to_string(),
|
||||
|
|
@ -155,7 +155,7 @@ fn loadable_tool_spec_namespace_serializes_with_deferred_child_tools() {
|
|||
value,
|
||||
json!({
|
||||
"type": "namespace",
|
||||
"name": "mcp__codex_apps__calendar",
|
||||
"name": "mcp__calendar_mcp__calendar",
|
||||
"description": "Plan events",
|
||||
"tools": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ use serde_json::json;
|
|||
use std::collections::BTreeMap;
|
||||
use std::collections::HashMap;
|
||||
|
||||
const CODEX_APPS_MCP_SERVER_NAME: &str = "codex_apps";
|
||||
const DEMO_MCP_SERVER_NAME: &str = "demo_mcp";
|
||||
const DEFAULT_AGENT_TYPE_DESCRIPTION: &str = "Test agent type description.";
|
||||
const DEFAULT_WAIT_TIMEOUT_MS: i64 = 30_000;
|
||||
const MIN_WAIT_TIMEOUT_MS: i64 = 10_000;
|
||||
|
|
@ -1208,7 +1208,7 @@ fn search_tool_description_lists_each_mcp_source_once() {
|
|||
&tools_config,
|
||||
Some(HashMap::from([
|
||||
(
|
||||
ToolName::namespaced("mcp__codex_apps__calendar", "_create_event"),
|
||||
ToolName::namespaced("mcp__calendar_mcp__calendar", "_create_event"),
|
||||
mcp_tool(
|
||||
"calendar_create_event",
|
||||
"Create calendar event",
|
||||
|
|
@ -1223,22 +1223,22 @@ fn search_tool_description_lists_each_mcp_source_once() {
|
|||
Some(vec![
|
||||
deferred_mcp_tool(
|
||||
"_create_event",
|
||||
"mcp__codex_apps__calendar",
|
||||
CODEX_APPS_MCP_SERVER_NAME,
|
||||
"mcp__calendar_mcp__calendar",
|
||||
DEMO_MCP_SERVER_NAME,
|
||||
Some("Calendar"),
|
||||
Some("Plan events and manage your calendar."),
|
||||
),
|
||||
deferred_mcp_tool(
|
||||
"_list_events",
|
||||
"mcp__codex_apps__calendar",
|
||||
CODEX_APPS_MCP_SERVER_NAME,
|
||||
"mcp__calendar_mcp__calendar",
|
||||
DEMO_MCP_SERVER_NAME,
|
||||
Some("Calendar"),
|
||||
Some("Plan events and manage your calendar."),
|
||||
),
|
||||
deferred_mcp_tool(
|
||||
"_search_threads",
|
||||
"mcp__codex_apps__gmail",
|
||||
CODEX_APPS_MCP_SERVER_NAME,
|
||||
"mcp__mail_mcp__gmail",
|
||||
DEMO_MCP_SERVER_NAME,
|
||||
Some("Gmail"),
|
||||
Some("Find and summarize email threads."),
|
||||
),
|
||||
|
|
@ -1270,7 +1270,7 @@ fn search_tool_description_lists_each_mcp_source_once() {
|
|||
assert!(!description.contains("mcp__rmcp__echo"));
|
||||
|
||||
assert!(handlers.contains(&ToolHandlerSpec {
|
||||
name: ToolName::namespaced("mcp__codex_apps__calendar", "_create_event"),
|
||||
name: ToolName::namespaced("mcp__calendar_mcp__calendar", "_create_event"),
|
||||
kind: ToolHandlerKind::Mcp,
|
||||
}));
|
||||
assert!(handlers.contains(&ToolHandlerSpec {
|
||||
|
|
@ -1284,8 +1284,8 @@ fn search_tool_requires_model_capability_and_enabled_feature() {
|
|||
let model_info = search_capable_model_info();
|
||||
let deferred_mcp_tools = Some(vec![deferred_mcp_tool(
|
||||
"_create_event",
|
||||
"mcp__codex_apps__calendar",
|
||||
CODEX_APPS_MCP_SERVER_NAME,
|
||||
"mcp__calendar_mcp__calendar",
|
||||
DEMO_MCP_SERVER_NAME,
|
||||
Some("Calendar"),
|
||||
/*connector_description*/ None,
|
||||
)]);
|
||||
|
|
|
|||
Reference in a new issue