shuiyu67
b577b0ff21
feat: FC 工具去重 + 按场景动态裁剪,降低 AI 每轮负担
方案 A(去重):
- mcp_to_openai_tools 末尾按 function.name 去重,消除 cache+builtin 叠加
造成的同名重复(memory/scheduler/lsp__* 等),FC 工具 42→36,去掉
约 14% 的垃圾 schema token
- get_liugin_usage_prompts 的 plugins 段由逐条 name:desc 改为工具名清单,
消除与 FC tools 字段的双重曝光,保留无 FC 模型的回退清单
方案 B(分层裁剪):
- 新增 prune_tools(fc_tools, user_input): 常驻 ALWAYS(tool_search/memory/
scheduler) + 外部桥接(mcp__)默认保留 + 按关键词信号追加对应工具
(代码/文件->code_editor+file_manager+lsp__*; git/shell/浏览器/搜索/子agent/
工程化各按信号)
- cli_core 两处 FC 构建点(TUI/CLI)接入 prune_tools(current_input)
实测(AICLI): 纯聊天 FC token ~4310->285(降93%),写代码 ~973(降77%)
测试: 新增 tests/test_prune_tools.py (7 passed),全量 324 passed 无回归
2026-08-06 20:06:51 +08:00
..
2026-04-26 05:40:09 +08:00
2026-08-05 19:07:15 +08:00
2026-08-05 21:23:16 +08:00
2026-08-05 17:40:45 +08:00
2026-08-05 16:12:35 +08:00
2026-08-05 17:56:25 +08:00
2026-08-05 17:56:25 +08:00
2026-08-05 15:57:38 +08:00
2026-08-05 19:07:15 +08:00
2026-08-06 20:06:51 +08:00
2026-08-05 17:16:49 +08:00
2026-08-05 16:12:35 +08:00
2026-08-05 19:43:30 +08:00