sync: 鍚屾灞€鍩熺綉鏈€鏂颁唬鐮?(source master @ b69568e4)
This commit is contained in:
1 parent
4f7f07504a
commit
8bc8b0e082
1651 files changed
+278599
-11416
No files matched your search
@@ -197,7 +197,7 @@ class RejectNodeRequest(BaseModel):
|
||||
|
||||
|
||||
class ActionPlanDictionaryOption(BaseModel):
|
||||
"""One task-system dictionary row, preserving dictValue as the model input."""
|
||||
"""One task-system dictionary row for fields still backed by an enum."""
|
||||
|
||||
label: str = Field(default="", max_length=256)
|
||||
value: str | int | float = ""
|
||||
@@ -207,10 +207,15 @@ class ActionPlanDictionaryOption(BaseModel):
|
||||
|
||||
|
||||
class ActionPlanDictionaries(BaseModel):
|
||||
"""The four action fields that must be selected from task-system dictionaries."""
|
||||
"""Task-system dictionaries for fields other than the model-derived action type.
|
||||
|
||||
``actionType`` is deliberately absent: the action planner must infer a
|
||||
concise type name from the roundtable material instead of choosing a
|
||||
frontend-provided dictionary value. Pydantic's default extra-field handling
|
||||
keeps legacy clients that still submit ``action_types`` compatible.
|
||||
"""
|
||||
|
||||
publish_channels: list[ActionPlanDictionaryOption] = Field(default_factory=list)
|
||||
action_types: list[ActionPlanDictionaryOption] = Field(default_factory=list)
|
||||
info_formats: list[ActionPlanDictionaryOption] = Field(default_factory=list)
|
||||
responsible_positions: list[ActionPlanDictionaryOption] = Field(default_factory=list)
|
||||
|
||||
@@ -1238,13 +1243,12 @@ async def _build_builtin_prompt(
|
||||
summary_content = _truncate_text(summary.get("content"), 12_000)
|
||||
dictionary_groups = (
|
||||
("发布渠道(publishChannel)", action_dictionaries.publish_channels if action_dictionaries else []),
|
||||
("行动类型(actionType)", action_dictionaries.action_types if action_dictionaries else []),
|
||||
("信息形式(infoFormat)", action_dictionaries.info_formats if action_dictionaries else []),
|
||||
("责任岗位(responsiblePosition)", action_dictionaries.responsible_positions if action_dictionaries else []),
|
||||
)
|
||||
dictionaries_ready = bool(action_task_id is not None and all(options for _, options in dictionary_groups))
|
||||
dictionary_lines = [
|
||||
"【前端传入的行动字典(名称 → 必须原样使用的 dictValue)】",
|
||||
"【前端传入的行动字段字典(名称 → 必须原样使用的 dictValue)】",
|
||||
f"- 当前 taskId:{action_task_id if action_task_id is not None else '(本地预览)'}",
|
||||
]
|
||||
for label, options in dictionary_groups:
|
||||
@@ -1254,12 +1258,15 @@ async def _build_builtin_prompt(
|
||||
for option in options
|
||||
)
|
||||
dictionary_instruction = (
|
||||
"actionType、publishChannel、infoFormat、responsiblePosition 必须从下方同名字典复制 dictValue 并写成整数;"
|
||||
"actionType 必须由你根据方案总结和岗位交付自行分析归纳,填写简洁、明确的中文类型名称;"
|
||||
"不要从前端字典选择 actionType,也不要填写 dictValue 或数字编码。"
|
||||
"publishChannel、infoFormat、responsiblePosition 必须从下方同名字典复制 dictValue 并写成整数;"
|
||||
"taskId 必须原样写为当前 taskId。不要保留 id、title、goal、basis、owner_position、dependencies 等旧字段,"
|
||||
"也不要用 0 或空值代替未选择的字典项。"
|
||||
"也不要用 0 或空值代替已提供的字典项。"
|
||||
if dictionaries_ready
|
||||
else "当前四类任务系统字典未获取完整,这是本地预览/接口未就绪状态。仍需生成 9 字段 JSON,"
|
||||
"但四个枚举字段可暂填 0 占位,且不得调用 position-roundtable-action-create Skill 或外部任务系统。"
|
||||
else "当前三类任务系统字典未获取完整,这是本地预览/接口未就绪状态。仍需生成 9 字段 JSON:"
|
||||
"actionType 仍须由你分析并填写中文类型名称;publishChannel、infoFormat、responsiblePosition 可暂填 0 占位,"
|
||||
"且不得调用 position-roundtable-action-create Skill 或外部任务系统。"
|
||||
)
|
||||
submit_instruction = (
|
||||
"若当前 taskId 是正整数,首次生成完整行动清单后按行动规划智能体的 SOUL 调用 position-roundtable-action-create Skill 批量新增行动;"
|
||||
@@ -1268,7 +1275,7 @@ async def _build_builtin_prompt(
|
||||
else "本轮字典不完整,只生成报告和 JSON 预览;不得调用 Skill、不得请求外部任务系统,也不能宣称行动已入库。"
|
||||
)
|
||||
instructions = [
|
||||
"请基于以下方案总结和岗位会商材料,生成或按用户要求修订《岗位会商行动规划》。",
|
||||
"请基于以下岗位会商材料,以及已生效的方案总结(如有),生成或按用户要求修订《岗位会商行动规划》。",
|
||||
"必须使用 write_file 分别写入两个最终交付:`/mnt/user-data/outputs/行动规划报告.md` 与 `/mnt/user-data/outputs/action-plan-subtasks.json`。",
|
||||
"Markdown 报告需给出分阶段推进建议、优先级、风险控制与验收安排。"
|
||||
"JSON 必须是严格合法数组;每个对象只能包含 actionName、actionDescription、actionType、"
|
||||
@@ -1276,8 +1283,8 @@ async def _build_builtin_prompt(
|
||||
dictionary_instruction,
|
||||
submit_instruction,
|
||||
"",
|
||||
"【已生效方案总结】",
|
||||
summary_content or "(方案总结正文未写入快照,请依据下方有效岗位交付重新归纳。)",
|
||||
"【已生效方案总结(如有)】",
|
||||
summary_content or "(本轮未生成方案总结;请直接依据下方有效岗位交付、任务信息和已确认意图进行归纳。)",
|
||||
"",
|
||||
*dictionary_lines,
|
||||
]
|
||||
@@ -1676,9 +1683,6 @@ async def _prepare_builtin_run(
|
||||
raise HTTPException(status_code=409, detail="所有岗位产物完成后才能生成或更新内置交付")
|
||||
|
||||
if kind == "action_plan":
|
||||
summary = session.get("summary_snapshot")
|
||||
if not isinstance(summary, dict) or summary.get("status") != "done":
|
||||
raise HTTPException(status_code=409, detail="请先生成有效的方案总结")
|
||||
thread_id = session.get("action_plan_thread_id")
|
||||
agent_id = ACTION_PLAN_AGENT_ID
|
||||
display_name = "行动规划智能体"
|
||||
|
||||
Reference in new issue
Block a user