alfworld-object-state-inspector ยท diff
git:20260307.388baa3 to git:20260316.e08426e
32 added, 20 removed. Audit A to A.
---
name: alfworld-object-state-inspector
- description: Checks the current state or contents of a specified object or receptacle. Trigger this skill when the agent needs to determine if an object is present, missing, or in a certain condition before proceeding with a task, such as verifying if a holder is empty or if an item is available. It typically follows navigation and involves observing the environment's feedback, providing crucial information for decision-making in the task flow.
+ description: Inspects a receptacle's contents by navigating to it and reading the observation. Use when you need to check what is on or inside a receptacle (e.g., "what's on the shelf", "is the holder empty", "check the table for items"). Executes `go to {receptacle}`, parses the observation listing items present, and decides whether to take an item, search elsewhere, or proceed.
---
# Instructions
- Use this skill to inspect the state of a target object or receptacle in an AlfWorld household environment. The primary goal is to obtain the observation feedback from the environment about what is currently on or in the target.
+ Inspect the state or contents of a target receptacle by navigating to it and parsing the environment's observation feedback.
- ## When to Trigger
- Trigger this skill immediately after navigating to a target receptacle (e.g., `go to toiletpaperhanger 1`) when you need to know:
- * If the target is empty.
- * What specific objects are present on/in the target.
- * The condition or state of the target (implied by the environment's observation).
+ ## Workflow
+ 1. **Navigate:** Execute `go to {target_receptacle}`
+ 2. **Read observation:** The environment automatically reports what is on/in the receptacle -- no additional inspection action is needed
+ 3. **Parse contents:** Look for patterns:
+ - `"On the {receptacle}, you see nothing."` -- receptacle is empty
+ - `"On the {receptacle}, you see a {item1}, and a {item2}."` -- items are present
+ 4. **Decide next action** based on the observation:
+ - Empty: search elsewhere for the needed item
+ - Item found: `take {item} from {receptacle}`
+ - Wrong items: move on to the next receptacle
- ## Core Procedure
- 1. **Navigate to Target:** First, ensure the agent has executed a `go to {target_receptacle}` action. This skill assumes the agent is already at the target's location.
- 2. **Observe Environment Feedback:** The skill is complete once the environment provides an observation in response to the navigation. **Do not perform an additional inspection action.** The observation from the `go to` action contains the state information.
- 3. **Parse Observation:** Interpret the observation message (e.g., "On the toiletpaperhanger 1, you see nothing." or "On the toilet 1, you see a soapbottle 1, and a toiletpaper 1.").
- 4. **Output Decision Data:** Based on the observation, determine the next step in the broader task (e.g., "Target is empty, proceed to find item" or "Target contains required item, proceed to pick it up").
+ ## Error Recovery
+ - "Nothing happened": the `go to` target name is invalid -- verify the receptacle name from your environment scan
+ - This skill uses only `go to` for navigation; it does not use `open`, `close`, or `toggle`
- ## Input/Output Format
- * **Input Context:** The agent must be at the target location. The last action should be `go to {target_receptacle}`.
- * **Output:** The observation string from the environment and a brief interpretation.
- * **Example Output:** `Observation: On the toiletpaperhanger 1, you see nothing. | Interpretation: The holder is empty. A toiletpaper roll must be found elsewhere.`
+ ## Example
- ## Error Handling
- * If the observation is "Nothing happened," the previous `go to` action was likely invalid. Re-evaluate the target's name or location.
- * This skill does not involve actions like `open`, `close`, or `toggle`. It relies solely on the observational feedback from navigation.
+ **Scenario 1:** Check if a toiletpaperhanger has toilet paper.
- **Key Principle:** This skill encapsulates the **waiting and parsing** of the environment's state disclosure after navigation. It provides the critical information needed to decide the subsequent `take`, `put`, or further `go to` action.
+ ```
+ Action: go to toiletpaperhanger 1
+ Observation: On the toiletpaperhanger 1, you see nothing.
+ ```
+
+ **Decision:** Holder is empty. Find a toiletpaper roll elsewhere and bring it here.
+
+ **Scenario 2:** Check a toilet for available items.
+
+ ```
+ Action: go to toilet 1
+ Observation: On the toilet 1, you see a soapbottle 1, and a toiletpaper 1.
+ ```
+
+ **Decision:** toiletpaper 1 is available. Execute `take toiletpaper 1 from toilet 1`.