def test_convert_handles_empty_agent_text():
  """Test agent responses with empty string text."""
  events = [
      build_event("user", [{"text": "Query"}]),
      build_event("agent", [{"text": "Okay"}]),
      build_event("agent", [{"text": ""}]),  # Empty text
      build_event("agent", [{"text": "Done"}]),
  ]
  session = Session(id="s1", app_name="app", user_id="u1", events=events)
  expected = [{
      "query": "Query",
      "expected_tool_use": [],
      "expected_intermediate_agent_responses": [
          {"author": "agent", "text": "Okay"},
      ],
      "reference": "Done",
  }]
  assert convert_session_to_eval_format(session) == expected
Test agent responses with empty string text.
tests/unittests/cli/utils/test_evals.py