From 1e68aa5d7bb9395b13a3cd9ceac4b358bdb5f303 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Wed, 15 Jul 2026 11:54:49 -0700 Subject: [PATCH] [eric] browser: send-script completes on X/IG/FB (submit-button vocab beyond LinkedIn Send) --- backend/apps/agents/browser/browser_agent.py | 17 ++++++++++++++--- backend/tests/test_browser_agent_loop.py | 14 ++++++++++++++ backend/tests/test_browser_send_script.py | 10 ++++++++-- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/backend/apps/agents/browser/browser_agent.py b/backend/apps/agents/browser/browser_agent.py index a51bc388..a0294799 100644 --- a/backend/apps/agents/browser/browser_agent.py +++ b/backend/apps/agents/browser/browser_agent.py @@ -473,13 +473,24 @@ def delta_state(text: str, seen_lines: set[str]) -> str: # A button row whose name is exactly a Send control (not "Send InMail credit" or "Send a message to X"); used to hand the model the Send button after it types, so it never burns turns hunting a button that's right there. P_SEND_ROW_RE = re.compile(r'\[(\d+)\]\*?<\s*button\s+"([^"]*)"', re.I) +# The submit-button labels across the popular composers, so the fast send-path COMPLETES on +# X/IG/FB/Threads/YouTube, not just LinkedIn. EXACT match + button-only (P_SEND_ROW_RE) is the +# safety: "Post" never matches "Post a job", a "Share" menuitem isn't a