Skip to content

Commit a0c593a

Browse files
committed
Don't call phantom skills
1 parent ceca36a commit a0c593a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

common/src/tools/params/tool/skill.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export const AVAILABLE_SKILLS_PLACEHOLDER = '{{AVAILABLE_SKILLS}}'
3434
// Base description - the full description with available skills is generated dynamically
3535
const baseDescription = `Load a skill by name to get its full instructions. Skills provide reusable behaviors and domain-specific knowledge that you can use to complete tasks.
3636
37+
The following are the only skills that are currently available (do not try to use any other skills):
3738
${AVAILABLE_SKILLS_PLACEHOLDER}
3839
3940
Example:

packages/agent-runtime/src/tools/prompts.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,11 @@ export const fullToolList = (
245245
if (name === 'skill' && availableSkillsXml) {
246246
desc = desc.replace(AVAILABLE_SKILLS_PLACEHOLDER, availableSkillsXml)
247247
} else if (name === 'skill') {
248-
// Remove placeholder if no skills available
249-
desc = desc.replace(AVAILABLE_SKILLS_PLACEHOLDER + '\n\n', '')
250-
desc = desc.replace(AVAILABLE_SKILLS_PLACEHOLDER, '')
248+
// Explicitly state no skills are available
249+
desc = desc.replace(
250+
AVAILABLE_SKILLS_PLACEHOLDER,
251+
'There are no skills available. Do not use this tool because there are no skills to load.',
252+
)
251253
}
252254
return desc
253255
}),
@@ -264,7 +266,7 @@ export const fullToolList = (
264266

265267
return `## List of Tools
266268
267-
These are the only tools that you (Buffy) can use. The user cannot see these descriptions, so you should not reference any tool names, parameters, or descriptions. Do not try to use any other tools -- even if referenced earlier in the conversation, they are not available to you, instead they may have been previously used by other agents.
269+
These are the only tools that you can use. The user cannot see these descriptions, so you should not reference any tool names, parameters, or descriptions. Do not try to use any other tools -- even if referenced earlier in the conversation, they are not available to you, instead they may have been previously used by other agents.
268270
269271
${descriptions.join('\n\n')}`.trim()
270272
}
@@ -350,13 +352,12 @@ export async function getToolSet(params: {
350352
description,
351353
}
352354
} else if (toolName === 'skill') {
353-
// Remove placeholder if no skills available
355+
// Explicitly state no skills are available
354356
let description = toolDef.description ?? ''
355357
description = description.replace(
356-
AVAILABLE_SKILLS_PLACEHOLDER + '\n\n',
357-
'',
358+
AVAILABLE_SKILLS_PLACEHOLDER,
359+
'There are no skills available. Do not use this tool because there are no skills to load.',
358360
)
359-
description = description.replace(AVAILABLE_SKILLS_PLACEHOLDER, '')
360361
toolSet[toolName] = {
361362
...toolDef,
362363
description,

0 commit comments

Comments
 (0)