"""The browser subsystem's click-by-index rows must never reach a human. `[1]` is what BrowserListInteractives hands the browser sub-agent so it can click by number. A user asked a normal agent to list a page's interactive elements and got those rows back verbatim in chat. The rows are produced in the renderer (frontend/src/shared/browserCommandHandler.ts) and ride into the transcript on the sub-agent's summary, so both the laundering and the renderer's template are pinned here. """ import asyncio import re from pathlib import Path from backend.apps.agents.browser import browser_agent as BA from backend.apps.agents.browser.browser_history import PAGE_STATE_MARKER from backend.apps.agents.browser.humanize_element_rows import humanize_element_rows # Verbatim from the bug report: six rows the agent pasted into a normal chat, on one line. LEAKED_REPLY = ( '[1] [2]