sync update from LAN repo (source dhk-1 @ 3e87be55)
This commit is contained in:
1 parent
ab6068a7c1
commit
42f2a26fa8
1482 files changed
+227759
-9584
No files matched your search
@@ -144,8 +144,8 @@ class _DesignFakeLLM:
|
||||
'"rationale": "贴合需求", "estimated_duration_seconds": 1200,'
|
||||
'"estimated_cost_level": "medium", "quality_gate_ids": ["cite_required"],'
|
||||
'"nodes": ['
|
||||
'{"slot_id": "research-a", "role_key": "researcher", "display_name": "研究员", "angle": "市场", "mission": "检索市场证据", "depends_on": [], "output_artifact_type": "EvidenceBundle"},'
|
||||
'{"slot_id": "write-main", "role_key": "writer", "display_name": "撰写员", "mission": "成稿", "depends_on": ["research-a"], "output_artifact_type": "ReportSectionDraft"}'
|
||||
'{"slot_id": "research-a", "agent_id": "ag-research", "role_key": "researcher", "display_name": "研究节点", "angle": "市场", "mission": "检索市场证据", "depends_on": [], "output_artifact_type": "EvidenceBundle"},'
|
||||
'{"slot_id": "write-main", "agent_id": "ag-writer", "role_key": "writer", "display_name": "撰写节点", "mission": "成稿", "depends_on": ["research-a"], "output_artifact_type": "ReportSectionDraft"}'
|
||||
']}'
|
||||
)
|
||||
|
||||
@@ -166,15 +166,28 @@ async def test_service_writes_plans_without_starting_a_run() -> None:
|
||||
status="clarifying",
|
||||
)
|
||||
command = await store.enqueue_plan_request(session["id"], idempotency_key="ik-plan", expected_revision=1)
|
||||
saved = await PlanProposalService(store, llm_factory=lambda: _DesignFakeLLM()).fulfill(
|
||||
agent_store = _AgentStore(
|
||||
[
|
||||
{"id": "ag-research", "name": "新能源汽车情报员", "description": "检索并分析新能源汽车市场信息"},
|
||||
{"id": "ag-writer", "name": "战略报告撰稿人", "description": "把研究成果写成面向管理层的报告"},
|
||||
]
|
||||
)
|
||||
saved = await PlanProposalService(
|
||||
store,
|
||||
agent_store=agent_store,
|
||||
llm_factory=lambda: _DesignFakeLLM(),
|
||||
).fulfill(
|
||||
session["id"], user_id="u1", command_id=command["command_id"], idempotency_key="ik-plan"
|
||||
)
|
||||
assert len(saved) == 1 # 智能体生成单份定制方案
|
||||
assert len(saved) == 3
|
||||
snapshot = await store.get_snapshot(session["id"])
|
||||
assert snapshot["session"]["status"] == "proposal_ready"
|
||||
assert snapshot["session"]["selected_plan_id"] is None
|
||||
assert snapshot["run"] is None
|
||||
assert snapshot["plans"][0]["strategy"] == "custom"
|
||||
custom_nodes = snapshot["plans"][0]["nodes"]
|
||||
assert [item["agent_id"] for item in custom_nodes] == ["ag-research", "ag-writer"]
|
||||
assert [item["role_display_name"] for item in custom_nodes] == ["新能源汽车情报员", "战略报告撰稿人"]
|
||||
assert all(item["requirement_revision"] == 1 for item in snapshot["plans"])
|
||||
assert snapshot["session"]["active_run_id"] is None
|
||||
ai = [item for item in snapshot["messages"] if item["role"] == "ai"][-1]
|
||||
|
||||
Reference in new issue
Block a user