[TASK-tsk_7e84048086b28189ce6edc7c] feat: Skills 列表精简化 — 内建 skill 全文改为仅名称+一行描述,按需加载 - #249
Open
jsyqrt wants to merge 1 commit into
Open
[TASK-tsk_7e84048086b28189ce6edc7c] feat: Skills 列表精简化 — 内建 skill 全文改为仅名称+一行描述,按需加载#249jsyqrt wants to merge 1 commit into
jsyqrt wants to merge 1 commit into
Conversation
…atalog — names only, descriptions on-demand
- tool-selector.ts: buildDiscoverTool now takes slim Array<{name}> instead of SkillManifest[]
- Skills listed as comma-separated names (no descriptions, no tags)
- Inactive tools listed as comma-separated names (no descriptions)
- Saves ~3,000+ tokens per system prompt injection
- agent.ts: pass skillRegistry.getSkillCatalog() mapped to {name} instead of .list()
- Avoids passing full instructions to tool selector
- New test: tool-selector.test.ts (9 tests) verifying slim output format
Token savings estimate:
Before: ~26 skills × ~130 chars + ~50 tools × ~140 chars ≈ 10,380 chars ≈ 3,500 tokens
After: ~26 skills × ~20 chars + ~50 tools × ~18 chars ≈ 1,420 chars ≈ 475 tokens
Net: ~3,000 tokens saved per turn in discover_tools description
Contributor
Author
⛔ Revision Required — Code Review by Code Reviewer✅ Passed
⛔ Blocking: 测试覆盖回归
修正要求:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📋 基本信息
🎯 背景与动机 (Why)
将 system prompt 中
discover_tools工具描述里的内建 skill 全文描述改为仅注入名称,完整内容保持通过list_skills按需加载。预估可节省 ~3,000 tokens/轮。🔧 变更内容 (What)
packages/core/src/tool-selector.ts:buildDiscoverTool的skillCatalog参数从SkillManifest[]改为Array<{name}>;技能列表和未激活工具列表都改为逗号分隔的名称列表(移除完整描述和(has instructions)标签)packages/core/src/agent.ts:skillRegistry.list()→skillRegistry.getSkillCatalog().map(s => ({name: s.name})),不再传递完整 manifestpackages/core/test/tool-selector.test.ts: 新增 9 个单元测试验证精简后的输出格式✅ 质量自检清单
Spec / 设计文档
测试覆盖
packages/core/test/tool-selector.test.ts(9 个用例覆盖精简输出格式)编译验证
👤 评审人