Commit bbfdb55
committed
fix(browser): route AsyncPlaywrightTool page_obs through async_execute_action
AsyncPlaywrightTool overrode `execute_action` — the base Tool's SYNC bridge —
with an async coroutine that did `await super().execute_action(...)`, which
always raised `TypeError: object Observation can't be used in 'await'
expression`. Meanwhile async callers (the gym-style `Task.step`, the harness
parallel-tool path, and the MCP server) enter through `async_execute_action`,
which fell through to the base implementation and returned a bare "Success",
silently dropping the page observation for every async browser action.
Move the page_obs override to `async_execute_action` (the native async entry,
mirroring SyncPlaywrightTool's sync `execute_action` override) and correct the
`super()` call. Update the async integration tests to use `async_execute_action`,
and add two CI-runnable regression tests (no browser): a structural guard that
the override lives on the async entry, and a behavioral check that it returns
the page observation (not "Success") with `tool_call_id` propagated.
Caught by scripts/smoke/tool_api.py, which now passes.
Signed-off-by: Alexandre Lacoste <alex.lacoste.shmu@gmail.com>1 parent d74c1f6 commit bbfdb55
2 files changed
Lines changed: 43 additions & 7 deletions
File tree
- cube-tools/cube-browser-tool
- src/cube_browser_tool
- tests
Lines changed: 7 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
450 | | - | |
451 | | - | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
452 | 457 | | |
453 | 458 | | |
454 | 459 | | |
| |||
Lines changed: 36 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
121 | 150 | | |
122 | 151 | | |
123 | 152 | | |
| |||
341 | 370 | | |
342 | 371 | | |
343 | 372 | | |
344 | | - | |
| 373 | + | |
345 | 374 | | |
346 | 375 | | |
347 | 376 | | |
| |||
350 | 379 | | |
351 | 380 | | |
352 | 381 | | |
353 | | - | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
354 | 385 | | |
355 | 386 | | |
356 | 387 | | |
| |||
369 | 400 | | |
370 | 401 | | |
371 | 402 | | |
372 | | - | |
| 403 | + | |
373 | 404 | | |
374 | 405 | | |
375 | 406 | | |
| |||
387 | 418 | | |
388 | 419 | | |
389 | 420 | | |
390 | | - | |
| 421 | + | |
391 | 422 | | |
392 | 423 | | |
393 | 424 | | |
| |||
0 commit comments