Skip to content

Commit 71f38f8

Browse files
committed
chore(skill-delegation): add entry/branch/dispatch debug logs
`SkillDelegationTool::execute` had three rejection branches and a dispatch call with no `log::debug!` lines, so the only way to diagnose a routing failure was to add prints. Per the project's verbose- diagnostics rule for new/changed flows, emit one entry log with the raw toolkit and prompt size, one log per rejection branch (missing toolkit, unknown toolkit, empty prompt), and one before the `integrations_agent` dispatch — all prefixed `[skill-delegation]` so a single grep traces the path.
1 parent 76a5b35 commit 71f38f8

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

src/openhuman/tools/impl/agent/skill_delegation.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,20 @@ impl Tool for SkillDelegationTool {
129129
.unwrap_or("")
130130
.trim()
131131
.to_string();
132+
log::debug!(
133+
"[skill-delegation] execute start tool='{}' raw_toolkit={:?} prompt_chars={}",
134+
self.tool_name,
135+
raw_toolkit,
136+
args.get("prompt")
137+
.and_then(|v| v.as_str())
138+
.map(|s| s.chars().count())
139+
.unwrap_or(0)
140+
);
132141
if raw_toolkit.is_empty() {
142+
log::debug!(
143+
"[skill-delegation] reject: missing `toolkit` argument for tool='{}'",
144+
self.tool_name
145+
);
133146
return Ok(ToolResult::error(format!(
134147
"{}: `toolkit` is required and must match a connected integration slug",
135148
self.tool_name
@@ -146,6 +159,12 @@ impl Tool for SkillDelegationTool {
146159
.iter()
147160
.map(|(slug, _)| slug.as_str())
148161
.collect();
162+
log::debug!(
163+
"[skill-delegation] reject: toolkit '{}' (sanitised='{}') not in connected set {:?}",
164+
raw_toolkit,
165+
slug,
166+
allowed
167+
);
149168
return Ok(ToolResult::error(format!(
150169
"{}: toolkit `{raw_toolkit}` is not connected — allowed: [{}]",
151170
self.tool_name,
@@ -160,12 +179,22 @@ impl Tool for SkillDelegationTool {
160179
.trim()
161180
.to_string();
162181
if prompt.is_empty() {
182+
log::debug!(
183+
"[skill-delegation] reject: empty `prompt` for tool='{}' toolkit='{}'",
184+
self.tool_name,
185+
slug
186+
);
163187
return Ok(ToolResult::error(format!(
164188
"{}: `prompt` is required",
165189
self.tool_name
166190
)));
167191
}
168192

193+
log::debug!(
194+
"[skill-delegation] dispatching toolkit='{}' to integrations_agent (prompt_chars={})",
195+
slug,
196+
prompt.chars().count()
197+
);
169198
super::dispatch_subagent("integrations_agent", &self.tool_name, &prompt, Some(&slug)).await
170199
}
171200
}

0 commit comments

Comments
 (0)