apodex/frontier-agent-demo
14
1"""submit_report — terminal tool for sub-agents (sibling of finalize_answer)."""2 3from __future__ import annotations4 5import logging6 7from frontier_agent.core.tool import tool8 9logger = logging.getLogger(__name__)10 11 12@tool13async def submit_report(content: str, confidence: float = 0.7) -> str:14 """Submit your final research report and end this task.15 16 Call this **once** when you have gathered enough evidence and are ready17 to return to the main agent. The solver loop terminates after this turn.18 19 Args:20 content: The complete report in the mandatory format:21 ``Scope: ...\\nFinding: ...\\nEvidence:\\n - ...\\nConfidence: ...``.22 Include exact values, source URLs, and code results — not just23 conclusions.24 confidence: Self-assessed confidence in [0, 1] that your findings25 are correct and well-sourced. Default 0.7.26 27 Returns:28 Short acknowledgement. The report body is surfaced to the main29 agent via ``<report agent="NAME">...</report>``.30 """31 text = (content or "").strip()32 if not text:33 return (34 "submit_report rejected: `content` was empty. "35 "Pass the complete Scope/Finding/Evidence report in `content`."36 )37 38 try:39 conf = max(0.0, min(1.0, float(confidence)))40 except (TypeError, ValueError):41 conf = 0.742 43 logger.info("submit_report called: len=%d chars, confidence=%.2f", len(text), conf)44 return (45 f"Report submitted ({len(text)} chars, confidence={conf:.2f}). "46 "Task loop will exit after this turn."47 )48 