feat: 新增 agentfx 任务深链与研判报告入库流程
支持 goPath=agentfx 的 iframe 嵌入问答、内置研判助手种子与报告导入协助卡,并完善深度研究流式报告能力。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
6e9e89a6cb
commit
52b9cbf707
34 files changed
+4488
-392
No files matched your search
+19
-1
@@ -57,7 +57,7 @@ _TOOL_SOURCE_TYPES: dict[str, str] = {
|
||||
}
|
||||
|
||||
# Tool results that never carry report materials.
|
||||
_IGNORED_TOOLS = {"ask_clarification", "write_todos"}
|
||||
_IGNORED_TOOLS = {"ask_clarification", "write_todos", "deep_research_report"}
|
||||
|
||||
|
||||
async def harvest_thread_materials(
|
||||
@@ -80,7 +80,24 @@ async def harvest_thread_materials(
|
||||
return [], ""
|
||||
values = checkpoint_tuple.checkpoint.get("channel_values", {}) or {}
|
||||
messages = values.get("messages") or []
|
||||
return harvest_messages_materials(messages, query=query)
|
||||
|
||||
|
||||
def harvest_messages_materials(
|
||||
messages: list[Any],
|
||||
*,
|
||||
query: str,
|
||||
) -> tuple[list[ResearchMaterial], str]:
|
||||
"""Convert an in-memory message list into research materials.
|
||||
|
||||
Same conversion as :func:`harvest_thread_materials` minus the checkpoint
|
||||
read — for callers that already hold the messages (e.g. a tool reading
|
||||
``runtime.state`` inside the same run).
|
||||
|
||||
Returns ``(materials, agent_summary)`` — the summary is the agent's last
|
||||
visible text (its collection小结) and doubles as a fallback material when
|
||||
the thread produced no harvestable tool results.
|
||||
"""
|
||||
materials = _harvest_tool_messages(messages, query=query)
|
||||
agent_summary = _last_assistant_text(messages)
|
||||
if not materials and agent_summary.strip():
|
||||
@@ -235,5 +252,6 @@ class StaticHarvestMaterialProvider:
|
||||
__all__ = [
|
||||
"MAX_HARVESTED_MATERIALS",
|
||||
"StaticHarvestMaterialProvider",
|
||||
"harvest_messages_materials",
|
||||
"harvest_thread_materials",
|
||||
]
|
||||
Reference in new issue
Block a user