test_case_id: test_mermaid_empty_syntax
description: "Tests graceful failure when provided with empty Mermaid syntax."
tags: ["all", "agent", "tools", "general_agent_tools"]
skip_intermediate_events: true

gateway_input:
  user_identity: "test_user@example.com"
  target_agent_name: "TestAgent"
  external_context:
    a2a_session_id: "session_mermaid_empty_syntax"
  prompt:
    parts:
      - text: "Generate a diagram with empty syntax."

llm_interactions:
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_def"
                type: "function"
                function:
                  name: "mermaid_diagram_generator"
                  arguments: '{"mermaid_syntax": ""}'
    expected_request:
      tools_present:
        - "mermaid_diagram_generator"
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I could not generate the diagram because the syntax was empty."
    expected_request:
      expected_tool_responses_in_llm_messages:
        - tool_call_id_matches_prior_request_index: 0
          response_contains: "UnknownDiagramError: No diagram type detected"

expected_gateway_output:
  - type: status_update
    kind: task
    id: '*'
    contextId: "session_mermaid_empty_syntax"
    status:
      state: unknown
      message:
        kind: message
        messageId: '*'
        role: agent
    event_purpose: tool_invocation_start
    expected_tool_name: "mermaid_diagram_generator"
  - type: final_response
    kind: task
    id: '*'
    contextId: "session_mermaid_empty_syntax"
    status:
      state: completed
      message:
        kind: message
        messageId: '*'
        role: agent
        parts:
          - type: text
            text_contains:

              - "I could not generate the diagram because the syntax was empty."
expected_artifacts: []
