test_case_id: "embed_artifact_meta_existing_specific_version_001"
description: "Tests «artifact_meta:file1.txt:0» resolves to a specific version's metadata."
tags: ["all","common","embeds"]
skip_intermediate_events: true

setup_artifacts:
  - filename: "file1.txt"
    mime_type: "text/plain"
    content: "Version 0 content"
    metadata: {"source": "initial_upload"}
  - filename: "file1.txt"
    mime_type: "text/markdown"
    content: "## Version 1 Content"
    metadata: {"source": "latest_upload"}
gateway_input:
  target_agent_name: "TestAgent"
  user_identity: "embed_tester@example.com"
  parts: [{type: "text", text: "Get metadata for file1.txt version 0"}]
  external_context: # ADD THIS BLOCK
    a2a_session_id: "fixed_session_for_artifact_meta_test_001"
llm_interactions:
  - static_response:
      choices: [{message: {role: "assistant", content: "Metadata: «artifact_meta:file1.txt:0»"}}]
expected_gateway_output:
  - type: "final_response"
    content_parts:
      - type: "text"
        text_contains: "--- Metadata for artifact 'file1.txt' (v0) ---"
      - type: "text"
        text_contains: "*   **Source:** initial_upload"
      - type: "text"
        text_contains: "*   **Type:** text/plain"
      - type: "text"
        text_contains: "*   **Schema Type:** text/plain"
      - type: "text"
        text_matches_regex: "\\*   size: \\d+" # Escaped asterisk for regex
