Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/sidecar/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,14 @@ fn resolve_toolkit_command(
)));
};
let callback_key = format!("{toolkit_name}:{tool_name}");
tracing::debug!(callback_key = %callback_key, "binding.invoke: resolving tool callback");
let Some(tool) = vm
.toolkits
.get(toolkit_name)
.and_then(|toolkit| toolkit.callbacks.get(tool_name))
.cloned()
else {
tracing::warn!(callback_key = %callback_key, "binding.invoke: unknown tool callback");
return Ok(ToolCommandResolution::Failure(format!(
"unknown tool callback {callback_key}"
)));
Expand All @@ -251,6 +253,7 @@ fn resolve_toolkit_command(
),
PermissionMode::Allow
) {
tracing::warn!(callback_key = %callback_key, "binding.invoke: blocked by policy");
return Ok(ToolCommandResolution::Failure(format!(
"blocked by binding.invoke policy for {callback_key}"
)));
Expand All @@ -269,6 +272,11 @@ fn resolve_toolkit_command(
return Ok(ToolCommandResolution::Failure(message));
}
let timeout_ms = tool.timeout_ms.unwrap_or(DEFAULT_TOOL_TIMEOUT_MS);
tracing::info!(
callback_key = %callback_key,
timeout_ms,
"binding.invoke: resolved tool callback"
);

Ok(build_command_callback_resolution(
&callback_key,
Expand Down
Loading