From dcba6d4e35ac8ca7f9ee06cc42493cd31f6927d9 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Fri, 5 Jun 2026 20:07:08 -0700 Subject: [PATCH] Revert "[eric] browser: redundant-read flag survives intervening reads, catches re-list clusters" This reverts commit 1a86ee2ad054a2c32bb46f8e13a08f0db6a11d67. --- backend/apps/agents/browser/browser_agent.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/apps/agents/browser/browser_agent.py b/backend/apps/agents/browser/browser_agent.py index 29d75b5a..4e3b6216 100644 --- a/backend/apps/agents/browser/browser_agent.py +++ b/backend/apps/agents/browser/browser_agent.py @@ -1313,10 +1313,9 @@ async def run_browser_agent( ) if _auto_state: result["text"] = f"{result.get('text') or ''}{_auto_state}" - # a mutation attached fresh state; it stays "available" through - # intervening reads (Wait/Extract don't invalidate it), so a - # later solo re-list is still caught as redundant. - fresh_state_pending = True + # mutating actions hand back fresh state; reads don't. drives the + # redundant-read nudge below. + fresh_state_pending = bool(_auto_state) # Deferred replay re-check: the orchestrator often opens a fresh # card on the wrong host, so the dispatch-time replay missed. Once @@ -1436,7 +1435,6 @@ async def run_browser_agent( if (tu.name in ("BrowserListInteractives", "BrowserGetText") and _had_fresh_state and "error" not in result): redundant_read_nudges += 1 - fresh_state_pending = False # nudge once per attached-state cluster logger.info( f"[browser-batching {session_id}] redundant-read nudge #{redundant_read_nudges} " f"({tu.name}) at turn {turn}"