# tests/integration/scenarios_declarative/test_data/image_tools/describe_image/test_describe_image_empty_artifact.yaml
test_case_id: "describe_image_empty_artifact"
description: "Tests how the tool handles an artifact that is empty (0 bytes). Artifact pre-loading fails before tool execution."
tags: ["all", "agent", "tools", "image_tools"]
skip_intermediate_events: true

setup_artifacts:
  - filename: "empty_image.png"
    mime_type: "image/png"
    content_base64: "" # Empty content

gateway_input:
  user_prompt: "Describe the empty_image.png file."
  user_identity: "test_user@example.com"
  target_agent_name: "TestAgent"
  tool_names: ["describe_image"]

llm_interactions:
  # First LLM call: Agent decides to use the tool
  - static_response:
      choices:
        - message:
            role: "assistant"
            tool_calls:
              - id: "call_describe_image_empty_1"
                type: "function"
                function:
                  name: "describe_image"
                  arguments: '{"input_image": "empty_image.png"}'
    expected_request:
      tools_present: ["describe_image"]

  # Second LLM call: Agent processes the artifact pre-load error
  # (Artifact loading now happens in wrapper before tool execution)
  - static_response:
      choices:
        - message:
            role: "assistant"
            content: "I tried to describe the image, but the artifact content was not found."

expected_gateway_output:
  - type: "final_response"
    kind: task
    id: '*'
    contextId: session_describe_image_empty_artifact
    status:
      state: "completed"
      message:
        kind: message
        messageId: '*'
        role: agent
        parts:
          - type: "text"
            text_contains:
              - "artifact content was not found"
