-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbox_starter.py
More file actions
40 lines (34 loc) · 2.14 KB
/
Copy pathbox_starter.py
File metadata and controls
40 lines (34 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import sys
sys.path.insert(0, '/Users/skshibu/agisdk/src')
from agisdk import REAL
from agisdk.REAL.gbox_claude_agent import GboxClaudeAgentArgs, GboxClaudeAgentConfig
# Configuration
BOX_ID = "b6b6e925-3d4f-40f7-a18c-9aa5277370dd" # Your persistent box
NUM_WORKERS = 1 # Must be 1 for persistent box mode
RUN_ID = "febd9069-007a-4b51-be08-de5f65e27901"
LEADERBOARD = True
# Configure agent
gbox_config = GboxClaudeAgentConfig(
server_name="gbox-browser",
box_id=BOX_ID, # Pass the box_id to the agent config
system_prompt='\nYou operate benchmark browsers on fake testing websites strictly according to these rules:\n1. Never interact with the small chrome://new-tab-page window (the CDP tab). List tabs first and only switch to non-CDP tabs.\n2. Do not close ANY tabs or refresh pages unless the task explicitly requires it and you explain why first.\n3. Use the MCP tools as intended; call list_tabs before switch_tab/close_tab, and retry any tool error once before giving up.\n4. You may use the provided placeholder data (phone: 415-634-2251, email: gbox@gmail.com, address: 149 New Montgomery St 4th Floor, San Francisco, CA 94105) whenever needed.\n5. never instruct the mcp to X out of a banner or pop-up because it is not accurate enough to close them. if you must please give extremly extremly detailed instructions on where to click.\nBreaking these rules ends the benchmark. Respond succinctly and follow the user instructions ALWAYS.\n',
)
agent_args = GboxClaudeAgentArgs(config=gbox_config)
# Run harness with persistent box
# The box will be reused across all tasks, with each task getting a fresh CDP URL
harness = REAL.harness(
agentargs=agent_args,
num_workers=NUM_WORKERS,
task_type="opendining",
headless=False,
max_steps=25,
use_screenshot=False,
use_axtree=False,
viewport={"width": 1920, "height": 980},
run_id=RUN_ID,
leaderboard=LEADERBOARD,
persistent_box_id=BOX_ID # Key addition: reuse this box instead of creating fresh ones
)
results = harness.run()
# Box remains alive after tasks complete - terminate manually if needed
# To terminate: gbox_sdk.GboxSDK().client.v1.boxes.terminate(box_id=BOX_ID)