from __future__ import annotations

from app.services.agent_turn_service import AgentTurnService


def test_format_tool_observations_hints_on_empty_search():
    service = AgentTurnService(llm_client=object())  # type: ignore[arg-type]
    text = service._format_tool_observations(
        [
            {
                "tool": "search_text",
                "tool_call_id": "call-1",
                "success": True,
                "pattern": "@app.route",
                "match_count": 0,
                "files_scanned": 1,
                "output": "",
            }
        ]
    )

    assert "match_count" in text or "0 matches" in text
    assert "FastAPI" in text
    assert "app/api/routes" in text
