Commit 59ef7cb
committed
fix: convert scroll_at direction/magnitude to scroll_x/scroll_y in GoogleCUAClient
Previously, GoogleCUAClient._process_provider_response was passing the raw direction and magnitude fields from Google CUA's scroll_at function call directly into the ScrollAction payload. This caused Pydantic validation errors because ScrollAction expects scroll_x and scroll_y fields instead.
This change:
- Safely extracts direction and magnitude with defaults (down, 800)
- Converts direction/magnitude to scroll_x/scroll_y values
- Handles all four directions (up, down, left, right) with proper sign
- Gracefully handles missing or non-numeric magnitude values
- Removes the unsupported direction error path
The fix now correctly produces ScrollAction payloads that validate and execute properly when scrolling in the browser.1 parent 9823ad3 commit 59ef7cb
1 file changed
+26
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
278 | | - | |
279 | 277 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
285 | 287 | | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
296 | 303 | | |
297 | 304 | | |
298 | 305 | | |
299 | 306 | | |
300 | 307 | | |
301 | | - | |
302 | | - | |
| 308 | + | |
| 309 | + | |
303 | 310 | | |
304 | 311 | | |
305 | 312 | | |
| |||
0 commit comments