PHASE 2: Cooperative Multi-Robot Task Replanning (robot_1 and robot_2):
"""
- Objective:
  - Divide robot_1’s long-range task into subtasks shared between robot_1 (main agent) and robot_2 (collaborative agent).
  - Optimize spatial and logical collaboration using scene graph connectivity and task flow.
- Planning constraints:
  - robot_2’s start position must be:
    - Must randomly select a valid start region.
    - Non-adjacent to robot_1’s start region.
    - Connected via the scene graph to both the object region and the transfer region.
  - Collaborative type: robot_2 helps deliver target object to a transfer region, robot_1 completes delivery.
  - The transfer region must:
    - Be accessible to both robots.
    - Contain a valid asset suitable for object handoff.
    - Not be **same as** the target object region.
  - Subtasks must follow:
    - use a transfer region with valid assets.
    - robot_1 must:
      - Move_to(transfer_asset RegionID)
      - Grab(object)
      - Move_to(end_asset RegionID)
      - Release(object)
    - robot_2 must:
      - Move_to(object RegionID)
      - Grab(object)
      - Move_to(transfer_asset RegionID)
      - Release(object)
  - Subtask instruction must follow these exact sentence templates:
    - robot_1: "Take the [object] from the [transfer asset] in [transfer region] to the [end asset] in [end region]."
    - robot_2: "Take the [object] from [target region] to the [transfer asset] in [transfer region]."
    - Strict constraints:
      - You MUST NOT alter the sentence structure.
      - You MUST NOT swap robot roles or change task flow logic.
      - The instruction MUST clearly and unambiguously describe where the object is taken from and where it is delivered.
      - The instruction MUST align exactly with the Subtask list in logic and sequence.
- Output keys (Phase 2):
  - "Collaborative robot start region": Starting region of robot_1 and robot_2.
  - "Transfer region": Region where the object handoff occurs.
  - "Subtask instruction": Natural language instructions for robot_1 and robot_2.
  - "Subtask list": Ordered action lists for robot_1 and robot_2, with primitives:
      - Move_to("object_RegionID")
      - Move_to("asset_RegionID")
      - Grab("object")
      - Release("object")
"""
You can call function to help validate and reason:
"""
- check_collab_path_efficient_sim_graph(robot_2_start_region, transfer_region, transfer_asset):
  - Purpose: Check whether a given collaborative plan achieves better execution efficiency than robot_1 executing the full task alone
  - INPUT:
    - robot_2_start_region: robot_2's start region (RegionType_RegionID).
    - transfer_region: transfer region (RegionType_RegionID).
    - transfer_asset: a valid asset suitable for handoff in transfer region.
  - OUTPUT:
    - efficient: True/False
"""
Use the following step-by-step reasoning process to ensure the plan satisfies all constraints and results in a valid cooperative execution plan.
"""
1. Randomly select a valid start region for robot_2:
  - Randomize among qualified candidates while maximizing path diversity.
  - Must NOT be adjacent to robot_1’s start region.
  - Must be connected via the scene graph to the target object region.
2. Based on the collaborative type and robot_2’s region, decide whether a transfer region is required. If required:
  - It must be reachable by both robot_1 and robot_2.
  - It must **not same as** the target object region.
  - It must contain a valid asset suitable for handoff (e.g., shelf, table, desk).
3. Validate all pairwise constraints using tool calls:
  - You MUST call `check_collab_path_efficient_sim_graph()` with:
    - robot_2’s proposed start region,
    - the selected transfer region,
    - the selected transfer asset,
  - If the returned `efficient` is True:
    - Must not re-call `check_collab_path_efficient_sim_graph()`.
    - you MUST remember the exact triplet of: robot_2_start_region, transfer_region, transfer_asset to finish the plan.
  - If the returned `efficient` is False:
    - You MUST restart the planning process:
      - Re-sample a new robot_2 start region and/or a new transfer region.
      - You MUST discard the previous inefficient regions.
    - Then, you MUST re-call `check_collab_path_efficient_sim_graph()` on the new setup.
    - Repeat until a valid (efficient: True) combination is found.
4. Output the result in the following strict JSON format:
{
  "phase_2": {
    "Collaborative robot start region": {
      "robot_1": "RegionType_RegionID",
      "robot_2": "RegionType_RegionID"
    },
    "Transfer region": "RegionType_RegionID",
    "Subtask instruction": {
      "robot_1": "...",
      "robot_2": "..."
    },
    "Subtask list": {
      "robot_1": [
        "Move_to('transfer_asset_RegionID')",
        "Grab('object_name')",
        "Move_to('end_asset_RegionID')",
        "Release('object_name')"
      ],
      "robot_2": [
        "Move_to('object_name_RegionID')",
        "Grab('object_name')",
        "Move_to('transfer_asset_RegionID')",
        "Release('object_name')"
      ]
    }
  }
}
"""
GENERAL CONSTRAINTS:
"""
- Always respect scene graph connectivity ("link" field).
- Use region function and assets to determine pickup and dropoff points.
- Once a function call to `check_collab_path_efficient_sim_graph()` returns `efficient: true`, you MUST remember the exact triplet of:
  - robot_2_start_region
  - transfer_region
  - transfer_asset
- Your final output MUST use exactly the same triplet that was confirmed as efficient.
- You MUST NOT generate new combinations without validating them again.
- Output JSON must include "phase_2" key with the described structure. Do not explain your reasoning in the final answer.
- Additional strict naming rules (Move_to arguments):
  - Format must be Move_to('<entity>_<RegionID>'), must not use a RegionType as <entity>.
  - During object transport:
    - robot_2’s first step must be Move_to('<objectName>_<targetRegionID>')
    - When either robot moves to the transfer region, use Move_to('<transferAssetName>_<transferRegionID>')
    - robot_1’s final delivery step must be Move_to('<endAssetName>_<endRegionID>')
"""