Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/agentlab/analyze/agent_xray.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def tag_screenshot_with_action(screenshot: Image, action: str) -> Image:
try:
coords = action[action.index("(") + 1 : action.index(")")].split(",")
Comment on lines 550 to 551

This comment was marked as resolved.

coords = [c.strip() for c in coords]
if len(coords) != 2:
if len(coords) not in [2, 3]:
raise ValueError(f"Invalid coordinate format: {coords}")
Copy link

Copilot AI Apr 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated validation now accepts 3 coordinates, yet the subsequent code only processes the first two values. Consider handling the third coordinate appropriately or adding documentation to clarify its intended use.

Suggested change
raise ValueError(f"Invalid coordinate format: {coords}")
raise ValueError(f"Invalid coordinate format: {coords}")
# Only the first two coordinates (x, y) are used. The third coordinate, if present, is ignored.

Copilot uses AI. Check for mistakes.
Comment on lines +553 to 554

This comment was marked as resolved.

if coords[0].startswith("x="):
coords[0] = coords[0][2:]
Expand Down
Loading