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 11:52:46 +01:00
committed by GitHub
Unverified
parent 0870352241
commit e6757bba91
3 changed files with 12 additions and 1 deletions
+1
View File
@@ -3829,6 +3829,7 @@ dependencies = [
"serde",
"serde_json",
"tokio",
"tracing",
"url",
]
+1
View File
@@ -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]
+10 -1
View File
@@ -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(),