mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
nit: cap error (#27585)
Just cap an error that could end up in the model context
This commit is contained in:
Generated
+1
@@ -3829,6 +3829,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ schemars = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
serde_json = { workspace = true }
|
||||
tokio = { workspace = true, features = ["sync", "time"] }
|
||||
tracing = { workspace = true }
|
||||
url = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -84,7 +84,16 @@ impl ToolExecutor<ToolCall> for ReadTool {
|
||||
mcp_resources: self.context.mcp_resources.clone(),
|
||||
})
|
||||
.await
|
||||
.map_err(|err| FunctionCallError::RespondToModel(err.message))?;
|
||||
.map_err(|err| {
|
||||
tracing::warn!(
|
||||
error = %err,
|
||||
turn_id = %call.turn_id,
|
||||
call_id = %call.call_id,
|
||||
resource = requested_resource.as_str(),
|
||||
"skills.read provider request failed"
|
||||
);
|
||||
FunctionCallError::RespondToModel("failed to read skill resource".to_string())
|
||||
})?;
|
||||
if result.resource != requested_resource {
|
||||
return Err(FunctionCallError::Fatal(
|
||||
"skill provider returned a different resource".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user