Files
PlantAI-dev/tests/unit/test_analysis_plan_handoff_contract.py

16 lines
673 B
Python

from pathlib import Path
PROJECT_ROOT = Path(__file__).resolve().parents[2]
def test_analysis_plan_handoff_does_not_forward_main_agent_intent() -> None:
source = (PROJECT_ROOT / "apps/web/vue3/index.html").read_text(encoding="utf-8")
start = source.index("const planData = await fetchJsonWithTimeout('/api/agent/plan'")
end = source.index("}, 180000, '多智能体规划');", start)
payload_source = source[start:end]
assert "message: data.handoff_request || userInput" in payload_source
assert "...(data.action === 'propose_utility' ? { intent: data.intent } : {})" in payload_source
assert "intent: data.intent //" not in payload_source