test_case_id: "embed_ac_recursive_template_with_embed_001"
description: "Tests recursive resolution: template contains an artifact_content embed."
tags: ["all","common","embeds"]
skip_intermediate_events: true

setup_artifacts:
  - filename: "data_for_template.json"
    mime_type: "application/json"
    content: '{"target_artifact_name": "inner_content.txt"}'
  - filename: "inner_content.txt"
    mime_type: "text/plain"
    content: "This is the deeply embedded content."
  - filename: "outer_template.mustache"
    mime_type: "text/mustache" # Or text/plain
    content: "Template renders: «artifact_content:{{target_artifact_name}}>>>format:text»"
gateway_input:
  target_agent_name: "TestAgent"
  user_identity: "embed_late_tester@example.com"
  parts: [{type: "text", text: "Render recursive template"}]
llm_interactions:
  - static_response:
      choices: [{message: {role: "assistant", content: "Result: «artifact_content:data_for_template.json>>>apply_to_template:outer_template.mustache>>>format:text»"}}]
expected_gateway_output:
  - type: "final_response"
    content_parts:
      - type: "text"
        text_contains: "Result: Template renders: This is the deeply embedded content."
