feat: 明确导出报告正式导出口径

This commit is contained in:
2026-06-04 02:18:36 +08:00
parent 5808dd794d
commit e81f0f891e
4 changed files with 75 additions and 3 deletions

View File

@@ -511,3 +511,40 @@ def test_feishu_notification_report_builds_notification_payload_with_receipt_and
assert result.notification_payload["message_status"] == "sent"
assert result.notification_payload["web_detail_url"] == "https://example.com/audit/3"
assert result.notification_payload["receipt"]["message_id"] == "msg-3"
def test_registration_word_export_report_preserves_formal_export_flag_and_blocked_items():
scenario = {
"id": "document_review",
"name": "注册审核智能体",
"agent": {
"role": "注册审核助手",
"goal": "输出导出结果",
"instructions": ["输出结构化导出结果"],
},
"rag": {"enabled": False},
"tools": [],
"output": {"type": "registration_word_export_report"},
}
provider_response = """
{
"summary": "已生成草稿导出包。",
"export_status": "draft_only",
"can_export_formally": false,
"blocked_items": ["风险项未清零", "需人工复核后再导出"],
"download_url": "/downloads/registration-draft.docx"
}
"""
class FakeProvider:
def generate(self, messages, response_format=None):
from agent_core.llm_provider import LLMResponse
return LLMResponse(content=provider_response, model_name="demo-model", success=True)
result = run_agent(scenario, "请输出导出结果", options={"llm_provider": FakeProvider()})
assert result.structured_output["can_export_formally"] is False
assert result.structured_output["download_url"] == "/downloads/registration-draft.docx"
assert result.structured_output["blocked_items"] == ["风险项未清零", "需人工复核后再导出"]
assert result.node_results[6]["status"] == "待复核"