Spaces:
Running
Running
| """Testy anty-pętli Autopilota (recursion_limit).""" | |
| def test_should_continue_forces_audit_on_graph_step_limit(): | |
| from agents.generator_agent import DocumentGeneratorAgent | |
| agent = DocumentGeneratorAgent() | |
| state = { | |
| "sections_plan": [{"title": "A"}, {"title": "B"}], | |
| "current_section_idx": 0, | |
| "is_completed": False, | |
| "missing_data_question": None, | |
| "graph_step": 50, | |
| } | |
| assert agent._should_continue(state) == "audit" | |
| def test_should_continue_skips_resolve_after_stall(): | |
| from agents.generator_agent import DocumentGeneratorAgent | |
| agent = DocumentGeneratorAgent() | |
| state = { | |
| "sections_plan": [{"title": "A"}], | |
| "current_section_idx": 0, | |
| "is_completed": False, | |
| "missing_data_question": "Podaj NIP", | |
| "section_stall_counts": {"0": 2}, | |
| "graph_step": 3, | |
| } | |
| assert agent._should_continue(state) == "continue" | |