From f03dde7e0c43a064dadffbf671f5823b6c090587 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Thu, 4 Jun 2026 16:38:56 -0700 Subject: [PATCH] [eric] browser: focus text boxes by node and insert text directly, reaches compose iframes clicks miss --- backend/apps/agents/browser/browser_schema.py | 19 ++++++++++-- frontend/src/shared/browserCommandHandler.ts | 30 +++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/backend/apps/agents/browser/browser_schema.py b/backend/apps/agents/browser/browser_schema.py index e1d318b2..255caadf 100644 --- a/backend/apps/agents/browser/browser_schema.py +++ b/backend/apps/agents/browser/browser_schema.py @@ -216,7 +216,10 @@ BROWSER_TOOLS_SCHEMA = [ "Uses native OS-level mouse events (event.isTrusted=true) so it works " "on sites that filter out synthetic JS events. Always call " "BrowserListInteractives first to get a fresh index list. If the click " - "returns 'index no longer valid', the page changed; re-list and retry." + "returns 'index no longer valid', the page changed; re-list and retry. " + "If the index is a TEXT BOX (role textbox or searchbox), it is " + "focused directly by node (no coordinates, so it works inside messaging/" + "compose overlays where clicks miss); pass `text` to fill it in one call." ), "input_schema": { "type": "object", @@ -225,6 +228,14 @@ BROWSER_TOOLS_SCHEMA = [ "type": "integer", "description": "The numeric index from BrowserListInteractives (1-based).", }, + "text": { + "type": "string", + "description": ( + "Optional. If the index is a text box, focus it and type this " + "whole string in one call (no character-by-character). Use this " + "to fill a compose/message box reliably." + ), + }, "expect": _EXPECT_DESC, }, "required": ["index"], @@ -586,7 +597,11 @@ SYSTEM_PROMPT = ( "Call BrowserListInteractives to get a numbered list (`[1]