fix(skills): hide skill_manage from LLM when skill_evolve is off

- skill_manage builtin tool default Enabled: true (available in registry)
- When skill_evolve=false: filter skill_manage from both tool definitions
  (API params) and system prompt tooling section — agent has zero awareness
- When skill_evolve=true: tool visible + system prompt guidance + nudges
- Update UI hints to reflect tool is available by default
This commit is contained in:
viettranx committed 2026-03-17 12:05:48 +07:00
1 parent 0dea765b74
commit d205691a13
6 files changed
+26 -5

No files matched your search

+1 -1
View File
@@ -105,7 +105,7 @@ func builtinToolSeedData() []store.BuiltinToolDef {
{Name: "skill_search", DisplayName: "Skill Search", Description: "Search for available skills by keyword or description to find relevant capabilities", Category: "skills", Enabled: true},
{Name: "use_skill", DisplayName: "Use Skill", Description: "Activate a skill to use its specialized capabilities (tracing marker)", Category: "skills", Enabled: true},
{Name: "publish_skill", DisplayName: "Publish Skill", Description: "Register a skill directory (created via skill-creator) in the system database, making it discoverable and grantable to agents", Category: "skills", Enabled: true},
{Name: "skill_manage", DisplayName: "Skill Manager", Description: "Create, patch, or delete skills from conversation experience. Admin must enable per agent.", Category: "skills", Enabled: false},
{Name: "skill_manage", DisplayName: "Skill Manager", Description: "Create, patch, or delete skills from conversation experience", Category: "skills", Enabled: true},
// teams
{Name: "team_tasks", DisplayName: "Team Tasks", Description: "View, create, update, and complete tasks on the team task board", Category: "teams", Enabled: true,
+12
View File
@@ -525,6 +525,18 @@ func (l *Loop) runLoop(ctx context.Context, req RunRequest) (*RunResult, error)
toolDefs = bootstrapDefs
}
// Hide skill_manage from LLM when skill_evolve is off.
// Tool stays in the registry (shared) but won't appear in API tool definitions.
if !l.skillEvolve {
filtered := toolDefs[:0:0]
for _, td := range toolDefs {
if td.Function.Name != "skill_manage" {
filtered = append(filtered, td)
}
}
toolDefs = filtered
}
chatReq := providers.ChatRequest{
Messages: messages,
Tools: toolDefs,
+10 -1
View File
@@ -132,8 +132,17 @@ func (l *Loop) buildMessages(ctx context.Context, history []providers.Message, s
}
}
// Build MCP tool descriptions for inline mode (not search mode).
// Build tool list, filtering out skill_manage when skill_evolve is off.
toolNames := l.filteredToolNames()
if !l.skillEvolve {
filtered := toolNames[:0:0]
for _, n := range toolNames {
if n != "skill_manage" {
filtered = append(filtered, n)
}
}
toolNames = filtered
}
var mcpToolDescs map[string]string
if !hasMCPToolSearch {
mcpToolDescs = l.buildMCPToolDescs(toolNames)
+1 -1
View File
@@ -102,7 +102,7 @@
"selfEvolutionInfo": "Agent will evolve its style over time through SOUL.md updates. Only style and tone are affected — identity and workflow rules stay fixed.",
"skillLearning": "Skill Learning",
"skillLearningLabel": "Allow agent to create and manage skills from experience",
"skillLearningHint": "When enabled, the agent can capture reusable workflows as skills after complex tasks. The agent will be gently reminded to save useful patterns. Requires the skill_manage tool to be enabled.",
"skillLearningHint": "When enabled, the agent receives guidance and gentle reminders to capture reusable workflows as skills after complex tasks. The skill_manage tool is available by default.",
"skillLearningInfo": "After complex tasks, the agent may suggest saving the workflow as a reusable skill. User approval is always required before any skill is created. Skills are private to the owner by default.",
"skillNudgeIntervalLabel": "Nudge after N tool calls",
"skillNudgeIntervalHint": "After this many tool calls, the agent will suggest saving the workflow as a skill. Set to 0 to disable post-task suggestions (system prompt guidance still shown).",
+1 -1
View File
@@ -102,7 +102,7 @@
"selfEvolutionInfo": "Agent sẽ tiến hóa phong cách theo thời gian qua các cập nhật SOUL.md. Chỉ phong cách và giọng điệu bị ảnh hưởng — nhận dạng và quy tắc quy trình làm việc vẫn cố định.",
"skillLearning": "Học kỹ năng",
"skillLearningLabel": "Cho phép agent tạo và quản lý kỹ năng từ trải nghiệm",
"skillLearningHint": "Khi được bật, agent có thể lưu lại quy trình làm việc tái sử dụng thành kỹ năng sau các tác vụ phức tạp. Agent sẽ được nhắc nhẹ để lưu các mẫu hữu ích. Cần bật tool skill_manage.",
"skillLearningHint": "Khi được bật, agent nhận hướng dẫn và nhắc nhở nhẹ để lưu lại quy trình làm việc tái sử dụng thành kỹ năng sau các tác vụ phức tạp. Tool skill_manage được bật mặc định.",
"skillLearningInfo": "Sau các tác vụ phức tạp, agent có thể đề xuất lưu quy trình thành kỹ năng tái sử dụng. Luôn cần sự đồng ý của người dùng trước khi tạo kỹ năng. Kỹ năng mặc định là riêng tư.",
"skillNudgeIntervalLabel": "Nhắc sau N lệnh tool",
"skillNudgeIntervalHint": "Sau số lượng lệnh tool này, agent sẽ đề xuất lưu quy trình thành kỹ năng. Đặt 0 để tắt đề xuất sau tác vụ (hướng dẫn trong system prompt vẫn hiển thị).",
+1 -1
View File
@@ -102,7 +102,7 @@
"selfEvolutionInfo": "Agent将通过 SOUL.md 更新随时间进化其风格。只有风格和语调受影响 — 身份和工作流规则保持固定。",
"skillLearning": "技能学习",
"skillLearningLabel": "允许Agent从经验中创建和管理技能",
"skillLearningHint": "启用后,Agent可以在复杂任务后将可重用的工作流程保存为技能。Agent会被温和地提醒保存有用的模式。需要启用 skill_manage 工具。",
"skillLearningHint": "启用后,Agent会收到指导和温和的提醒,在复杂任务后将可重用的工作流程保存为技能。skill_manage 工具默认可用。",
"skillLearningInfo": "在复杂任务后,Agent可能会建议将工作流程保存为可重用技能。创建技能前始终需要用户批准。技能默认为私有。",
"skillNudgeIntervalLabel": "N 次工具调用后提醒",
"skillNudgeIntervalHint": "达到此工具调用次数后,Agent会建议将工作流程保存为技能。设为 0 可禁用任务后建议(系统提示词中的指导仍然显示)。",