Skip to content

"Skipping duplicate agent skill name" log spam#303878

Merged
aeschli merged 1 commit intomainfrom
aeschli/pale-pike-729
Mar 22, 2026
Merged

"Skipping duplicate agent skill name" log spam#303878
aeschli merged 1 commit intomainfrom
aeschli/pale-pike-729

Conversation

@aeschli
Copy link
Contributor

@aeschli aeschli commented Mar 22, 2026

No description provided.

@aeschli aeschli enabled auto-merge (squash) March 22, 2026 16:06
Copilot AI review requested due to automatic review settings March 22, 2026 16:06
@aeschli aeschli self-assigned this Mar 22, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.113.0 milestone Mar 22, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces noisy Window output logging during agent skill discovery by downgrading several skill-validation/discovery warnings to debug, addressing repeated “Skipping duplicate agent skill name” spam reported in multi-root / multi-skill-source setups.

Changes:

  • Downgraded skill name/description sanitization warnings (XML tag stripping, truncation) from warn to debug.
  • Downgraded skill discovery warnings (missing name fallback, name mismatch, duplicate-name skip) from warn to debug.
  • Minor cleanup in the affected logging block (removed an extra blank line).

Comment on lines 1072 to 1096
private truncateAgentSkillName(name: string, uri: URI): string {
const MAX_NAME_LENGTH = 64;
const sanitized = this.sanitizeAgentSkillText(name);
if (sanitized !== name) {
this.logger.warn(`[findAgentSkills] Agent skill name contains XML tags, removed: ${uri}`);
this.logger.debug(`[findAgentSkills] Agent skill name contains XML tags, removed: ${uri}`);
}
if (sanitized.length > MAX_NAME_LENGTH) {
this.logger.warn(`[findAgentSkills] Agent skill name exceeds ${MAX_NAME_LENGTH} characters, truncated: ${uri}`);
this.logger.debug(`[findAgentSkills] Agent skill name exceeds ${MAX_NAME_LENGTH} characters, truncated: ${uri}`);
return sanitized.substring(0, MAX_NAME_LENGTH);
}
return sanitized;
}

private truncateAgentSkillDescription(description: string | undefined, uri: URI): string | undefined {
if (!description) {
return undefined;
}
const MAX_DESCRIPTION_LENGTH = 1024;
const sanitized = this.sanitizeAgentSkillText(description);
if (sanitized !== description) {
this.logger.warn(`[findAgentSkills] Agent skill description contains XML tags, removed: ${uri}`);
this.logger.debug(`[findAgentSkills] Agent skill description contains XML tags, removed: ${uri}`);
}
if (sanitized.length > MAX_DESCRIPTION_LENGTH) {
this.logger.warn(`[findAgentSkills] Agent skill description exceeds ${MAX_DESCRIPTION_LENGTH} characters, truncated: ${uri}`);
this.logger.debug(`[findAgentSkills] Agent skill description exceeds ${MAX_DESCRIPTION_LENGTH} characters, truncated: ${uri}`);
return sanitized.substring(0, MAX_DESCRIPTION_LENGTH);
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log prefix here says [findAgentSkills], but these messages are emitted from truncateAgentSkillName / truncateAgentSkillDescription and can also happen during validateAndSanitizeSkillFile (extension-contributed skills) and computeSkillDiscoveryInfo. Consider updating the prefix to reflect the helper/function emitting the message so logs are easier to trace.

Copilot uses AI. Check for mistakes.
Comment on lines 1475 to 1478
const sanitizedName = this.truncateAgentSkillName(name, uri);
if (sanitizedName !== folderName) {
this.logger.warn(`[computeSkillDiscoveryInfo] Agent skill name "${sanitizedName}" does not match folder name "${folderName}", using folder name: ${uri}`);

this.logger.debug(`[computeSkillDiscoveryInfo] Agent skill name "${sanitizedName}" does not match folder name "${folderName}", using folder name: ${uri}`);
}
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log message claims the folder name will be used when the sanitized name doesn't match, but the code continues using sanitizedName for duplicate detection and for the loaded entry. Either adjust the message to match the behavior, or actually switch to using the folder name in this branch (consistent with the agentskills folder-name spec and the wording of the message).

See below for a potential fix:

				const headerName = parsedFile.header?.name;
				let name = headerName;

				if (!name) {
					this.logger.debug(`[computeSkillDiscoveryInfo] Agent skill file missing name attribute, using folder name "${folderName}": ${uri}`);
					name = folderName;
				}

				const sanitizedName = this.truncateAgentSkillName(name, uri);
				const folderSanitizedName = this.truncateAgentSkillName(folderName, uri);
				let effectiveName = sanitizedName;

				if (headerName && sanitizedName !== folderName) {
					this.logger.debug(`[computeSkillDiscoveryInfo] Agent skill name "${sanitizedName}" does not match folder name "${folderName}", using folder name: ${uri}`);
					effectiveName = folderSanitizedName;
				}

				if (seenNames.has(effectiveName)) {
					this.logger.debug(`[computeSkillDiscoveryInfo] Skipping duplicate agent skill name: ${effectiveName} at ${uri}`);
					files.push({ uri, storage, status: 'skipped', skipReason: 'duplicate-name', name: effectiveName, duplicateOf: nameToUri.get(effectiveName), extensionId, source });
					continue;
				}

				const description = parsedFile.header?.description;

				seenNames.add(effectiveName);
				nameToUri.set(effectiveName, uri);
				const disableModelInvocation = parsedFile.header?.disableModelInvocation === true;
				const userInvocable = parsedFile.header?.userInvocable !== false;
				files.push({ uri, storage, status: 'loaded', name: effectiveName, description, extensionId, source, disableModelInvocation, userInvocable });

Copilot uses AI. Check for mistakes.
@aeschli aeschli merged commit ba842b2 into main Mar 22, 2026
23 checks passed
@aeschli aeschli deleted the aeschli/pale-pike-729 branch March 22, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants