mirror of
https://github.com/openai/codex.git
synced 2026-09-13 11:47:17 +00:00
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
16 lines
485 B
Rust
16 lines
485 B
Rust
//! Access structured MCP errors without dropping their original protocol data.
|
|
|
|
use anyhow::Error;
|
|
use rmcp::ErrorData;
|
|
use rmcp::service::ServiceError;
|
|
|
|
use crate::rmcp_client::ClientOperationError;
|
|
|
|
/// Returns the server's structured protocol error, including its original data.
|
|
pub fn mcp_error(error: &Error) -> Option<&ErrorData> {
|
|
let ClientOperationError::Service(ServiceError::McpError(error)) = error.downcast_ref()? else {
|
|
return None;
|
|
};
|
|
Some(error)
|
|
}
|