test_case_id: "embed_ac_recursive_size_limit_in_parent_001"
description: "Tests recursive resolution total size limit in parent artifact."
tags: ["common","embeds"]
skip_intermediate_events: true

# Gateway config for this test (via fixture override or specific test setup):
# gateway_max_artifact_resolve_size_bytes: 50 (or a low value)
# This test is hard to make fully declarative without per-test gateway config.
# It will demonstrate successful resolution if the default size limit (100MB) is active.
# A programmatic test is better for precise limit testing.
# This YAML will assume the default limit is large enough.
setup_artifacts:
  - filename: "parent_doc.txt"
    mime_type: "text/plain"
    content: "Content: «artifact_content:child_doc1.txt>>>format:text» and «artifact_content:child_doc2.txt>>>format:text»"
  - filename: "child_doc1.txt"
    mime_type: "text/plain"
    content: "First child (20b)." # Approx 20 bytes
  - filename: "child_doc2.txt"
    mime_type: "text/plain"
    content: "Second child (21b)." # Approx 21 bytes
gateway_input:
  target_agent_name: "TestAgent"
  user_identity: "embed_late_tester@example.com"
  parts: [{type: "text", text: "Test recursive size limit"}]
llm_interactions:
  - static_response:
      choices: [{message: {role: "assistant", content: "«artifact_content:parent_doc.txt>>>format:text»"}}]
expected_gateway_output:
  - type: "final_response"
    content_parts:
      - type: "text"
        # Expects full resolution if default size limit (100MB) is active.
        # If limit was 50, and parent_doc.txt itself is ~40 bytes + children, it might hit.
        # "Content: " is 9 bytes. " and " is 5 bytes. Total static = 14 bytes.
        # child1 is 20 bytes. child2 is 21 bytes. Total resolved = 14 + 20 + 21 = 55 bytes.
        # If limit was 50, this would fail.
        text_contains: "Content: First child (20b). and Second child (21b)."
