Skip to content

Commit 8035b86

Browse files
KaiLiKailigithub
authored andcommitted
fix(doctor): emit tool-policy profile audit at debug level
When tools.profile is set to a named profile (e.g. "coding"), the tool-policy pipeline removes tools that don't belong to that profile. The resulting audit lines ("tool policy removed N tool(s) via tools.profile (coding): ...") are expected behavior, not actionable doctor findings. These lines were emitted at info level, causing normal doctor output to look noisy when a profile filter is active. Now they are emitted at debug level so they appear in verbose/debug logs but not in regular doctor output. The fix is isolated to auditToolPolicyFilter in tool-policy-audit.ts. Only steps whose label starts with "tools.profile" are affected; other audit paths (agents.allow, tools.deny, etc.) continue to log at info level.
1 parent c237de5 commit 8035b86

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/agents/tool-policy-audit.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ export function auditToolPolicyFilter(params: {
176176
tools: matchedRuleSourceTools,
177177
});
178178
const matchedRuleSuffix = matchedRules.length > 0 ? `; matched ${matchedRules.join(", ")}` : "";
179-
toolPolicyAuditLogger.info(
179+
const isProfileFilter = params.stepLabel.startsWith("tools.profile");
180+
const logLevel = isProfileFilter ? "debug" : "info";
181+
toolPolicyAuditLogger[logLevel](
180182
`tool policy removed ${removed.length} tool(s) via ${rule}: ${toolNames.join(", ")}${matchedRuleSuffix}`,
181183
{
182184
rule,

0 commit comments

Comments
 (0)