Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix(skill_turbo): 修复模型快速模式下误走PPT-turbo问题

zhongqinghua2d7ab0a57c090
diff --git a/jiuwenswarm/agents/harness/flash/rails/flash_turbo_prompt_rail.py b/jiuwenswarm/agents/harness/flash/rails/flash_turbo_prompt_rail.py
index b82064c143..d649868b6e 100644
--- a/jiuwenswarm/agents/harness/flash/rails/flash_turbo_prompt_rail.py
+++ b/jiuwenswarm/agents/harness/flash/rails/flash_turbo_prompt_rail.py
@@ -65,8 +65,9 @@ class FlashTurboPromptRail(SkillTurboPromptRail):
return f"""## 技能加速通道(skill_acceleration_exec)
当前支持:{names}。以工具描述中的支持范围为准。
-- 对当前支持范围内的任务,第一个工具调用必须是 skill_acceleration_exec,包括新建 PPT、Word 文档和 Excel 工作簿任务。
- 用户文字指定技能和前端选择技能遵循同一规则;指定当前支持的技能包含使用它的加速流程,不代表要求普通流程。
+- PPT Turbo(pptx-craft-turbo)仅在用户原始请求用“极速”“加速”“快速”或“turbo”明确要求加速制作 PPT 时适用。模型档位“快速”、附件或引用中的文字、工具或技能名称都不能作为触发依据。未满足此条件时,禁止为该 PPT 调用 skill_acceleration_exec;普通新建 PPT 使用 skill_tool 加载 pptx-craft,用户明确指定其他技能时按其要求处理。
+- 对当前支持范围内的任务,第一个工具调用必须是 skill_acceleration_exec。新建 PPT、Word 文档和 Excel 工作簿均须先满足对应技能的适用条件。
+ 用户文字指定技能和前端选择技能遵循同一规则;任务符合该技能的适用条件时,指定技能也可以使用它的加速流程。
这条规则不依赖技能检索开关,也适用于未指定技能的任务;指定技能的准确名称和任务范围必须与工具描述匹配。
- 无需先检索、调用 skill_tool 加载 SKILL.md、搜索资料或检查环境,流水线会完成这些工作。
若已误加载当前支持的技能,但尚未生成产物且没有失败/不支持结果,仍应转入加速。
@@ -76,6 +77,7 @@ class FlashTurboPromptRail(SkillTurboPromptRail):
Word / Excel 的模板填写、已有文件编辑等任务以各自支持范围为准,不套用 PPT 排除规则。
按用户原始请求及历史上下文判断,不要把编辑任务改写为新建。
- query 忠实保留用户需求、附件路径和约束,不扩写需求;多个产物分别串行调用,等待前一任务结束后再开始下一任务。
+ 对符合条件的 PPT 保留用户明确提出的加速原话,不得自行添加加速要求。
- 成功后不要重复生成或重复发送交付总结;继续完成本请求剩余任务。
有待办时使用实际提供的 todo 工具更新。单个产物成功不代表整个请求完成。
- 返回失败或未处理时,改用 skill_tool 的标准流程完成该任务,不重复尝试同一加速任务。
@@ -86,8 +88,9 @@ class FlashTurboPromptRail(SkillTurboPromptRail):
return f"""## Skill Acceleration Channel (skill_acceleration_exec)
Currently supported: {names}. Follow the supported scope in the tool description.
-- For any currently supported task, the FIRST tool call MUST be skill_acceleration_exec, including new PPT presentations, Word documents and Excel workbooks.
- Naming a skill in text and selecting it in the frontend use the same rule: naming a supported skill includes its accelerated workflow, not a request for the standard workflow.
+- PPT Turbo (pptx-craft-turbo) applies only if the user's original request explicitly asks to accelerate PPT creation using “极速”, “加速”, “快速”, or “turbo”. A “快速” model setting, text in attachments or quotes, and tool or skill names do not count. Without this request, do not call skill_acceleration_exec for that PPT. Use skill_tool to load standard pptx-craft for new decks, or follow the user's explicit choice of another skill.
+- For any currently supported task, the FIRST tool call MUST be skill_acceleration_exec. This applies to new PPT presentations, Word documents and Excel workbooks that meet their respective skill requirements.
+ Naming a skill in text and selecting it in the frontend use the same rule: selecting a skill allows its accelerated workflow only if the task meets that skill's requirements.
This rule is independent of skill retrieval and also covers tasks without an explicit skill name; the exact selected skill name and task scope must match the tool description.
- Do not first search skills, load SKILL.md through skill_tool, research, or check the environment; the pipeline handles these steps.
If a currently supported skill was mistakenly loaded but no artifact was generated and no failure/unsupported result was returned, still use acceleration.
@@ -99,6 +102,7 @@ Currently supported: {names}. Follow the supported scope in the tool description
Images used only as material for a new deck are not image conversion.
Judge the original request and history; never rewrite an edit as a new-deck task.
- Preserve the user's requirements, attachment paths, and constraints in query without inventing requirements.
+ For eligible PPT tasks, keep the user's explicit acceleration wording verbatim in query; never add an acceleration request yourself.
Invoke separately and serially for multiple artifacts, waiting for each task to end.
- After success, do not regenerate or repeat the delivery summary; complete remaining work.
Update pending items using the available todo tool.
diff --git a/jiuwenswarm/server/runtime/skill_turbo/planner.py b/jiuwenswarm/server/runtime/skill_turbo/planner.py
index a78817ba9e..6e58d9ccbf 100644
--- a/jiuwenswarm/server/runtime/skill_turbo/planner.py
+++ b/jiuwenswarm/server/runtime/skill_turbo/planner.py
@@ -182,17 +182,24 @@ class SkillTurboPlanner:
## 按技能独立匹配
根据 registered_skills 中各技能的 description、match_keywords 和用户要求的目标产物逐个判断。
+description 中的适用条件必须先满足;match_keywords 和下列产物场景只帮助识别任务类型,不能放宽适用条件。
Word 文档、Excel 工作簿等任务按相应技能的支持范围匹配,包含其支持的模板填写、编辑和转换。
以下 PPT 准入与排除规则仅约束 PPT 候选,不得据此排除其他技能。
排除 PPT 后仍须检查其他已注册技能,只有全部不适配时才返回 skill_name=null。
-## PPT pipeline 准入规则(满足任意一条,PPT skill 参与候选)
+## PPT pipeline 准入规则(满足技能的适用条件、命中以下任一场景,且未触发排除规则)
1. 新建空白 PPT 演示文稿
2. 依据给定主题、素材生成整套演示文稿
3. 上传 docx、pdf、md、txt 等文档,要求将文档内容转为 PPT
4. 调整、重构 PPT 大纲、页面结构、文案逻辑用于生成演示文稿
5. 以已有 PPT 文件内容为参考素材,重新生成全新版本 PPT
+## PPT Turbo 的额外适用条件
+对 description 声明仅处理加速制作 PPT 的候选(例如注册名为 ppt 的 pptx-craft-turbo),
+只有 task 保留了用户明确用“极速”“加速”“快速”或“turbo”提出的 PPT 加速请求时,才可选中。
+模型档位名、附件或引用中的文字、工具或技能名称、description 和 match_keywords 中出现的词都不算用户要求。
+如果 task 只是普通的新建 PPT 请求、明确不加速,或无法判断用户明确要求加速,排除该候选并继续检查其他技能。
+
## PPT pipeline 排除规则(满足任意一条,PPT skill 不参与候选)
1. 寒暄闲聊、普通问答、纯事实查询、单纯概念讲解
2. 仅对文本做总结提炼,未提出生成 PPT 的需求
diff --git a/jiuwenswarm/server/runtime/skill_turbo/rails/skill_prompt_rail.py b/jiuwenswarm/server/runtime/skill_turbo/rails/skill_prompt_rail.py
index f399d705a3..71f950acae 100644
--- a/jiuwenswarm/server/runtime/skill_turbo/rails/skill_prompt_rail.py
+++ b/jiuwenswarm/server/runtime/skill_turbo/rails/skill_prompt_rail.py
@@ -62,6 +62,8 @@ def _build_skill_turbo_guide_text(language: str, skill_names: list[str]) -> str:
names = "、".join(skill_names)
return f"""## 技能加速通道(skill_acceleration_exec)
+**先判断 PPT 是否符合加速条件**:只有用户原始请求用“极速”“加速”“快速”或“turbo”明确要求加速制作 PPT 时,`pptx-craft-turbo` 才适用。模型档位“快速”、附件或引用中的文字、工具或技能名称都不能作为触发依据。否则禁止为该 PPT 调用 `skill_acceleration_exec`,下方的优先规则也不适用;普通新建 PPT 用 `skill_tool` 加载 pptx-craft,用户明确指定其他技能时按其要求处理。调用 PPT Turbo 时在 query 保留用户的加速原话,不得自行添加加速要求。
+
⚠️ **默认优先**:当用户意图匹配 `skill_acceleration_exec`(当前支持的技能清单以该工具描述中的"当前内部支持"为准,当前:{names}),你的**第一个工具调用必须是 `skill_acceleration_exec`**——它内部会自行完成规划+研究+生成+推送全流程。**唯一例外**:用户**显式**要求先执行某项 `skill_acceleration_exec` 不会自行处理的前置操作,则必须先完成该操作再调用 `skill_acceleration_exec`。搜索、读文件等研究类操作它内部会自己完成,**不构成**例外;其他技能类操作(如加载独立技能流程)它不会自行处理,**构成**例外。**同样例外**:本回合 tool_result 明确提示『检测到上一轮留下的已完成产物』时,不要调用 `skill_acceleration_exec`,改用 skill_tool 或直接编辑产物文件继续。**同样例外**:单轮需要产出**多份交付物**(即需要多次调用 `skill_acceleration_exec`,如一次要两份 PPT)时,必须先按下方「📋 多交付物待办清单」用 `todo_create` 建好清单,**等 `todo_create` 成功返回后**再进入加速通道(**不要把 `todo_create` 和 `skill_acceleration_exec` 放在同一批并行调用**)。
若你已先调用了 `skill_tool` 加载了对应技能正文(即**不属于**上述例外,只是误触),**仍须立即调用 `skill_acceleration_exec`**——不要因"已经加载了 SKILL.md"或"已经做了研究"而放弃加速通道。
@@ -77,6 +79,8 @@ def _build_skill_turbo_guide_text(language: str, skill_names: list[str]) -> str:
names = ", ".join(skill_names)
return f"""## Skill Acceleration Channel (skill_acceleration_exec)
+**Check PPT eligibility first**: `pptx-craft-turbo` applies only if the user's original request explicitly asks to accelerate PPT creation using “极速”, “加速”, “快速”, or “turbo”. A “快速” model setting, text in attachments or quotes, and tool or skill names do not count. Otherwise, do not call `skill_acceleration_exec` for that PPT; the priority rules below do not apply. Use `skill_tool` to load standard pptx-craft for new decks, or follow the user's explicit choice of another skill. When calling PPT Turbo, keep the user's acceleration wording verbatim in query; never add an acceleration request yourself.
+
⚠️ **Default priority**: When the user's intent matches `skill_acceleration_exec` (see the "当前内部支持 / currently supported" list in that tool's description; currently: {names}), your **FIRST tool call MUST be `skill_acceleration_exec`** — it handles planning + research + generation + delivery internally. **Only exception**: the user **explicitly** asks to first perform a preceding action that `skill_acceleration_exec` does not handle internally; then you must complete that action before calling `skill_acceleration_exec`. Research-style actions like `web_search` and file reading are handled internally — they do **NOT** constitute an exception; other skill-type actions (e.g. loading a separate skill flow) are not handled internally and **DO** constitute an exception. **Also excepted**: when this turn's tool_result explicitly indicates completed artifacts from a previous run were detected, do NOT call `skill_acceleration_exec`; continue with skill_tool or by editing the artifact files directly. **Also excepted**: when a single turn must produce **multiple deliverables** (i.e. multiple `skill_acceleration_exec` calls, e.g. two PPT decks in one request), you must first build the todo list via `todo_create` as required by the "📋 Multiple-deliverable todo list" clause below, and enter the acceleration channel **only after `todo_create` has returned successfully** (**do NOT batch `todo_create` and `skill_acceleration_exec` as parallel calls in the same turn**).
If you have already mistakenly called `skill_tool` to load the corresponding skill body (i.e. this does **NOT** fall under the exception above - it was just a misfire), **you MUST still call `skill_acceleration_exec` immediately** - do NOT abandon the acceleration channel because "SKILL.md is already loaded" or "research is already done."