feat(cloud-agent): 技能 description 进入 Agent 系统提示 manifest

compileCloudAgentPolicies 的技能 manifest 此前只含 skillId/name/version/hash/entryPath/files,模型看不到每个已激活技能是干什么的,无法在多技能间路由、也无法向用户解释为何选它。本改动把 SkillItem.Description(技能市场公开元数据)注入 manifest,并以 500 runes 为上限截断(描述由技能作者提供,需防止异常长的描述撑爆提示词预算)。skill_read_file 渐进披露边界不变:instruction 与文件正文仍不进入系统提示。
This commit is contained in:
Wyatt_K committed 2026-09-21 17:52:49 +08:00
1 parent c5b81f696c
commit 5fe27ae642
3 files changed
+32 -4

No files matched your search

+4 -1
View File
@@ -22,6 +22,7 @@ import (
type cloudAgentSkill struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Version string `json:"version"`
Hash string `json:"hash"`
Instruction string `json:"instruction,omitempty"`
@@ -60,7 +61,9 @@ func (s *Service) cloudAgentSkills(userID string, ids []string) ([]cloudAgentSki
}
// Skill content is loaded only after the model explicitly calls
// skill_read_file; keep the run context to stable metadata and paths.
snapshot := cloudAgentSkill{ID: id, Name: skill.SkillName, Version: skill.VersionID, Hash: skill.ContentHash, Files: map[string]string{cloudAgentSkillEntryPath: ""}}
// The description is public metadata (market listing) and lets the
// model route between activated skills without reading any body.
snapshot := cloudAgentSkill{ID: id, Name: skill.SkillName, Description: skill.Description, Version: skill.VersionID, Hash: skill.ContentHash, Files: map[string]string{cloudAgentSkillEntryPath: ""}}
files, err := s.SkillPackageFiles(userID, id)
if err != nil {
return nil, err