Skip to content

Commit ff495a0

Browse files
Subash ShibuSubash Shibu
authored andcommitted
Update agent code, add gitignore for trajectory files, and update report
1 parent b5e7699 commit ff495a0

7 files changed

Lines changed: 571 additions & 48 deletions

File tree

.gitignore

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,9 @@ cache/*
145145

146146
# TMP IGNORE
147147
agent/prompts/jsons/*
148-
log_files/
149-
results_full/
150148

151-
# Allow log_files and results_full in GBOX directory only
152-
!GBOX/log_files/
153-
!GBOX/log_files/**
154-
!GBOX/results_full/
155-
!GBOX/results_full/**
149+
150+
156151

157152
config_files*/*0.json
158153
config_files*/*1.json
@@ -166,3 +161,8 @@ config_files*/*8.json
166161
config_files*/*9.json
167162
config_files*/test.json
168163
.openhands/
164+
165+
# Trajectory data - too large for git, use cloud storage
166+
gbox/trajectories/results_full/traces/*.zip
167+
gbox/trajectories/results_full/*.html
168+
trace/*.png

agent/gbox_claude_agent.py

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def _create_claude_options(self, use_sonnet_4: bool = False) -> ClaudeAgentOptio
111111
tool_names = [
112112
"screenshot",
113113
"click",
114+
"hover",
114115
"type",
115116
"scroll",
116117
"press_key",
@@ -175,6 +176,10 @@ def _default_prompt(self) -> str:
175176
You are working on FAKE TESTING WEBSITES - clones designed to test AI agents.
176177
You are on the East Coast time zone and the year is 2025.
177178
179+
⚙️ GBOX ENVIRONMENT:
180+
- Profile name: byteblaze
181+
- You are operating through the gbox-mcp server with this profile
182+
178183
═══════════════════════════════════════════════════════════════════════
179184
YOUR TASK:
180185
═══════════════════════════════════════════════════════════════════════
@@ -191,8 +196,10 @@ def _default_prompt(self) -> str:
191196
192197
- screenshot(boxId): Capture current screen state
193198
- click(boxId, target): Click on element (describe the elements extremely precisely)
199+
- hover(boxId, target): Hover over element to reveal dropdowns, tooltips, or expandable menus.
200+
**CRITICAL FOR NESTED DROPDOWNS**: When you hover over a menu item and a dropdown appears, you MUST hover over items in that dropdown to check if there are sub-dropdowns before clicking anything. DO NOT click immediately - first explore all nested levels by hovering. Many navigation menus have multiple nested levels (e.g., Category → Subcategory → Sub-subcategory).
194201
- type(boxId, content, pressEnterAfterType): Type text into focused field
195-
- scroll(boxId, direction, distance): Scroll up means it will show the top of page and scroll down will move towards the bottom of page
202+
- scroll(boxId, direction, distance): Scroll up means it will show the top of page and scroll down will move towards the bottom of page
196203
- press_key(boxId, keys): Press keyboard keys (Use these when possible instead of clicking back button or any other clicks. Can be useful to scroll to the end of a page or top of a page rather than using scroll. These are always most reliable)
197204
- wait(boxId, duration): Wait for specified milliseconds
198205
- list_tabs(boxId): List all open browser tabs
@@ -229,6 +236,9 @@ def _default_prompt(self) -> str:
229236
Date interpretation: "after 2020" means from 2020 onwards (2020, 2021, 2022, ...)
230237
so be sure to include 2020 as part of the search.
231238
239+
**For address queries**: Ask for "complete street address including street number"
240+
Example: "What is the complete street address (including street number) of Pittsburgh International Airport?"
241+
232242
The subagent uses a search-first strategy with voting to cross-verify facts from multiple sources.
233243
234244
IMPORTANT - Handling Wikipedia Subagent Results:
@@ -277,7 +287,7 @@ def _default_prompt(self) -> str:
277287
GENERAL TIPS/Benchmark Quirks (VERY IMPORTANT):
278288
═══════════════════════════════════════════════════════════════════════
279289
280-
1. Its MUCH easier to find something on a website when theres a search bar instead of having to scroll through the whole page trying to locate it.
290+
1. It's MUCH easier to find something on a website when there's a search bar instead of having to scroll through the whole page trying to locate it.
281291
2. When asked to do a search task or information retrieval, it can be very useful to use FILTERS to narrow down the search results.
282292
3. There are a lot of information so it will take a very long time if you just keep scrolling trying to find it. Best way is to search or filter it!
283293
4. Examine screenshots thoroughly, especially keep an eye out for signs like this "-". These could be negative signs which are important.
@@ -288,8 +298,29 @@ def _default_prompt(self) -> str:
288298
8. For questions ONLY about **Nintendo Switch game cards** please navigate back to the url of the product you end up choosing. This is because the benchmark evalautes using the page you are on for the Nintendo task. If you are own the wrong product page it will assume you selected that product.
289299
9. When asked to "show me products under a price" the benchmark evaluates based on the url. so just ensure the price is under the price asked for in the url.
290300
10. When asked about product type don't return the acutal product name but rather the type of product it is. Ex: If the most common products are "harry potter" and "twilight" the product type is "books".
291-
11. Task wording can contain typos or singular/plural mismatches. Treat singular terms like "order" or "transaction" as potentially plural. If multiple entries match the described criteria, summarize all of them, list each matching item with its key details, make the quantity explicit, and when the question asks for an amount/total, include the combined sum alongside the itemized numbers. Never assume “the most recent one” unless the instructions explicitly say so.
292-
301+
11. When the task asks for the full address make sure to inclue **ZIP CODE** (this means choosing the address that has a zip code).
302+
12. **For ADDRESS questions**: A "full address" means a COMPLETE street address with ALL components (GET THE ADDRESS ALWAYS FROM OPENSTREETMAP!):
303+
- Street number (e.g., "1000")
304+
- Street name (e.g., "Airport Boulevard" or "International Drive")
305+
- City or Township
306+
- State
307+
- ZIP code
308+
- Country (if applicable)
309+
Example: "1000 Airport Boulevard, Pittsburgh, PA 15231, United States"
310+
If OpenStreetMap doesn't have the street number, try:
311+
- Using the Wikipedia subagent to find the official address
312+
- Searching for the location's "Contact" or "About" page
313+
- Cross-referencing multiple sources until you have the complete address
314+
13. Task wording can contain typos or singular/plural mismatches. Treat singular terms like "order" or "transaction" as potentially plural. If multiple entries match the described criteria, summarize all of them, list each matching item with its key details, make the quantity explicit, and when the question asks for an amount/total, include the combined sum alongside the itemized numbers. Never assume "the most recent one" unless the instructions explicitly say so.
315+
14. **For SHOPPING/BROWSING tasks**: When asked to browse products in a particular category, navigate using the dropdown menus (not search) when possible. This may require hovering over nested dropdowns (e.g., hover over "Electronics" → hover over "Computers" → click "Laptops"). Use the hover tool to reveal these nested menus before clicking.
316+
15. **When URLs/text are TRUNCATED with copy buttons**: If you see text that's cut off in the UI (e.g., "https://example.com/very-long-url..." with a copy button), click the copy button then PASTE it somewhere to see the full content:
317+
- Click the URL/address bar and press Ctrl+V
318+
- Or paste into a text field
319+
- Take a screenshot to see the complete untruncated text
320+
16. **For GitLab repository changes**: When asked to make changes to a repository, commit changes to the main branch UNLESS the task specifically asks you to create a branch, make a merge request, or follow a different workflow.
321+
17. **For GitLab SSH clone URLs**: Replace git@ec2-3-149-78-74.us-east-2.compute.amazonaws.com with git@metis.lti.cs.cmu.edu in the clone command.
322+
18. **For Postmill forum submissions**: When creating a post/submission, put all content including URLs in the Body field. Leave the URL field empty. Use EXACT text formatting from the task request (case-sensitive, same date format, same capitalization).
323+
19. **When asked to DRAFT a message/email/post**: DO NOT submit or send it. Just compose/write the draft and leave it in the compose window. The evaluator will assess the draft as-is. Only send/submit if explicitly instructed to do so.
293324
294325
295326
═══════════════════════════════════════════════════════════════════════
@@ -322,10 +353,16 @@ def _default_prompt(self) -> str:
322353
4. Execute actions one at a time
323354
5. Verify with screenshots after important actions
324355
6. Before finalizing, double-check whether multiple records match the request. If more than one does, aggregate the information and prepare a combined answer instead of choosing one arbitrarily.
356+
6a. **For ADDRESS tasks specifically**: Before calling complete_task(), verify you have ALL components:
357+
✅ Street number (e.g., "1000")
358+
✅ Street name (e.g., "Airport Boulevard")
359+
✅ City/Township
360+
✅ State + ZIP code
361+
If ANY component is missing, DO NOT call complete_task() yet. Continue searching until you find the complete address.
325362
7. When you have the answer, call complete_task() with EXACT format
326-
8. If the task asks for NUMERIC RESULT like number of orders or how much is spent and the correct answer is zero (including cases where no matching records exist), call complete_task(finalAnswer="0") instead of N/A.
327-
9. Only call complete_task(finalAnswer="N/A") when the task truly cannot be executed (e.g., page fails to load, required access is missing, instructions are contradictory). Lack of matching data is NOT impossible—use rule 8 instead.
328-
10. When the requested item doesn't exist, state that it wasn't found, report the numeric result as **0**, and do NOT substitute results from nearby dates or different criteria. If you do this you WILL FAIL the evaluation.
363+
8. If the task asks for a NUMERIC COUNT and nothing matches, call complete_task(finalAnswer="0").
364+
9. Call complete_task(finalAnswer="N/A") when the requested data/place/item doesn't exist or instructions are contradictory.
365+
10. When the requested item doesn't exist, do NOT substitute results from nearby/similar criteria. If you do this you WILL FAIL the evaluation.
329366
330367
331368
═══════════════════════════════════════════════════════════════════════
@@ -419,6 +456,7 @@ def _build_recovery_prompt(
419456
- screenshot(boxId): Capture current screen state (START WITH THIS!)
420457
- list_tabs(boxId): List all open browser tabs
421458
- click(boxId, target): Click on element
459+
- hover(boxId, target): Hover to reveal dropdowns/menus. IMPORTANT: Fully explore nested menus by hovering over dropdown items to check for sub-menus before clicking.
422460
- type(boxId, content, pressEnterAfterType): Type text
423461
- scroll(boxId, direction, distance): Scroll page
424462
- press_key(boxId, keys): Press keyboard keys
@@ -697,6 +735,12 @@ async def _run_claude_async(
697735
answer_part = content_str.split("TASK_COMPLETE:", 1)[1]
698736
# Clean up any trailing JSON artifacts
699737
final_answer = answer_part.strip().rstrip('"}').rstrip('"').strip()
738+
739+
# Unescape common escape sequences that Claude might include
740+
final_answer = final_answer.replace("\\'", "'")
741+
final_answer = final_answer.replace('\\"', '"')
742+
final_answer = final_answer.replace("\\\\", "\\")
743+
700744
is_complete = True
701745
logger.info(f"✅ Task complete: {final_answer}")
702746
transcript.append(f"[complete] {final_answer}")

0 commit comments

Comments
 (0)