Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

fix: correct inverted scroll direction mapping in Anthropic agent loop (#1281)

Ricardo-M-L95f60f3f8bfe
diff --git a/libs/python/agent/agent/loops/anthropic.py b/libs/python/agent/agent/loops/anthropic.py
index e0e087008f..194a1524e7 100644
--- a/libs/python/agent/agent/loops/anthropic.py
+++ b/libs/python/agent/agent/loops/anthropic.py
@@ -482,16 +482,16 @@ def _convert_responses_items_to_completion_messages(
scroll_y = action.get("scroll_y", 0)
# Determine direction and amount from scroll values
if scroll_x > 0:
- direction = "left"
+ direction = "right"
amount = scroll_x
elif scroll_x < 0:
- direction = "right"
+ direction = "left"
amount = -scroll_x
elif scroll_y > 0:
- direction = "up"
+ direction = "down"
amount = scroll_y
elif scroll_y < 0:
- direction = "down"
+ direction = "up"
amount = -scroll_y
else:
direction = "down"