| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Fix Google CUA `type_text_at` so `clear_before_typing` is honored in Python - Add `clear_before_typing` to [TypeAction] and wire it through [google_cua.py] - Update [CUAHandler] to clear fields via triple-click (with keyboard fallback) before typing - Add unit tests for CUA typing behavior and [TypeAction] defaults ## Details - Default `clear_before_typing` to `False` at the model level for backward compatibility - Default `clear_before_typing` to `True` when mapping Gemini `type_text_at` calls, matching TS client behavior - Use triple-click at the target coordinates to select all text, then type to replace - Fall back to `Meta+a` / `Control+a` + `Backspace` when no coordinates are provided ## Testing - `pytest tests/unit/handlers/test_cua_handler.py -v`
|
^^ If this could be reviewed, that would be great :)! This is breaking some of our workflows with Gemini in Stagehand. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
why
Stagehand’s Google CUA integration was ignoring clear_before_typing for type_text_at actions in the Python client.
As a result, when Gemini tried to overwrite input fields (e.g. email search fields), text kept getting appended instead of replaced, even when the model explicitly set clear_before_typing=True.
The TypeScript client already behaves correctly; this PR brings the Python client in line with that behavior.
what changed
test plan
test_clear_typing.py
Summary by cubic
Fixes the Python Google CUA client so type_text_at honors clear_before_typing, matching TS behavior and preventing accidental text appends. Defaults to clearing before typing for Gemini tool calls and adds reliable field clearing.
Written for commit 1801c1f. Summary will update automatically on new commits.