fix(ai): ai employee can`t use skills (#9023)

This commit is contained in:
Drol
2026-04-02 19:22:35 +08:00
committed by GitHub
parent 264132dc60
commit de4e9c95c1
3 changed files with 3 additions and 5 deletions
@@ -65,7 +65,7 @@ export default defineTools({
ctx,
sessionId: subSessionId,
employee,
model: employee.get('modelSettings') ?? ctx.action?.params?.values?.model,
model: ctx.action?.params?.values?.model ?? employee.get('modelSettings'),
question,
skillSettings,
writer,
@@ -1384,8 +1384,8 @@ If information is missing, clearly state it in the summary.</Important>`;
private async getAvailableSkills(): Promise<SkillsEntry[]> {
const { skillsManager } = this.plugin.ai;
const aIEmployeeTools = await this.getAIEmployeeTools();
const getSkills = aIEmployeeTools.find((it) => it.definition.name === 'getSkills');
if (!getSkills) {
const getSkill = aIEmployeeTools.find((it) => it.definition.name === 'getSkill');
if (!getSkill) {
return [];
}
const generalSkills = await skillsManager.listSkills({ scope: 'GENERAL' });
@@ -140,8 +140,6 @@ ${
? `<skills>
You have access to the following skills (tools groups). When a user's request matches a skill's description, use the **getSkill** tool to load that skill's detailed content and available tools
But if there is no tool named **getSkill** don't try to use **getSkill** tool to load skills
${availableSkills.map((skill) => `- **${skill.name}**: ${skill.description || 'No description'}`).join('\n')}
</skills>
`