mirror of
https://github.com/openai/codex.git
synced 2026-11-28 23:34:06 +00:00
Improve sandboxing, MCP errors, and cached approvals (#41196)
Expand Windows deny-read globs robustly across protected directories while preserving filesystem enforcement. Preserve structured MCP tool and resource errors through app-server responses. Bind cached Guardian classifications to current local and root authorization state so stale scores cannot approve actions. Add regression coverage for the sandbox resolver, structured protocol errors, and authorization changes. GitOrigin-RevId: 4b80ed724d869afeca79204222d8465fa99d3a24
This commit is contained in:
1 parent
0182ff3480
commit
035295b46e
18 files changed
+1285
-81
No files matched your search
@@ -509,7 +509,7 @@ impl McpRequestProcessor {
|
||||
origin_call_id: Option<String>,
|
||||
) {
|
||||
let result = result
|
||||
.map_err(|error| internal_error(format!("{error:#}")))
|
||||
.map_err(mcp_operation_error)
|
||||
.and_then(|result| {
|
||||
serde_json::from_value::<McpResourceReadResponse>(result).map_err(|error| {
|
||||
internal_error(format!(
|
||||
@@ -541,13 +541,24 @@ impl McpRequestProcessor {
|
||||
.call_mcp_tool(¶ms.server, ¶ms.tool, params.arguments, meta)
|
||||
.await
|
||||
.map(McpServerToolCallResponse::from)
|
||||
.map_err(|error| internal_error(format!("{error:#}")));
|
||||
.map_err(mcp_operation_error);
|
||||
outgoing.send_result(request_id, result).await;
|
||||
});
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn mcp_operation_error(error: anyhow::Error) -> JSONRPCErrorError {
|
||||
match codex_rmcp_client::mcp_error(&error) {
|
||||
Some(error) => JSONRPCErrorError {
|
||||
code: i64::from(error.code.0),
|
||||
message: error.message.to_string(),
|
||||
data: error.data.clone(),
|
||||
},
|
||||
None => internal_error(format!("{error:#}")),
|
||||
}
|
||||
}
|
||||
|
||||
fn with_mcp_tool_call_thread_id_meta(
|
||||
meta: Option<serde_json::Value>,
|
||||
thread_id: &str,
|
||||
|
||||
Reference in new issue
Block a user