nit: cap error (#27585)

Just cap an error that could end up in the model context
This commit is contained in:
jif
2026-06-11 12:52:46 +02:00
committed by GitHub
parent 0870352241
commit e6757bba91
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -3829,6 +3829,7 @@ dependencies = [
"serde", "serde",
"serde_json", "serde_json",
"tokio", "tokio",
"tracing",
"url", "url",
] ]
+1
View File
@@ -27,6 +27,7 @@ schemars = { workspace = true }
serde = { workspace = true, features = ["derive"] } serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true } serde_json = { workspace = true }
tokio = { workspace = true, features = ["sync", "time"] } tokio = { workspace = true, features = ["sync", "time"] }
tracing = { workspace = true }
url = { workspace = true } url = { workspace = true }
[dev-dependencies] [dev-dependencies]
+10 -1
View File
@@ -84,7 +84,16 @@ impl ToolExecutor<ToolCall> for ReadTool {
mcp_resources: self.context.mcp_resources.clone(), mcp_resources: self.context.mcp_resources.clone(),
}) })
.await .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 { if result.resource != requested_resource {
return Err(FunctionCallError::Fatal( return Err(FunctionCallError::Fatal(
"skill provider returned a different resource".to_string(), "skill provider returned a different resource".to_string(),