From 3c3dd6cfcc4f94dcdef8f4f11636ea949016e3df Mon Sep 17 00:00:00 2001 From: ciregenz Date: Thu, 4 Jun 2026 11:37:15 -0700 Subject: [PATCH] [eric] browser: prompt the agent to plan once then run terse batched turns --- backend/apps/agents/browser/browser_schema.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/apps/agents/browser/browser_schema.py b/backend/apps/agents/browser/browser_schema.py index c6fdeafe..4e2ae0c4 100644 --- a/backend/apps/agents/browser/browser_schema.py +++ b/backend/apps/agents/browser/browser_schema.py @@ -468,6 +468,18 @@ SYSTEM_PROMPT = ( "website the user is signed into; social media, dating apps, email, productivity " "tools, dashboards, ecommerce, anything. Assume the user has already logged in.\n\n" + "## Plan once up front, then execute tersely (this is how you stay fast)\n" + "Your first turn or two, once you can see the starting page, is your ONE planning " + "window: lay out the whole route in a few lines, the navigations, which buttons and " + "links you expect to click, what you'll read, and roughly where they sit. Treat it as " + "a guideline, not a contract: the live page may differ and you'll adjust, that's fine. " + "This plan stays in the conversation history, so you never re-derive it.\n" + "After that, go TERSE. Every later turn is mostly action, not narration: fire the next " + "step (batched whenever the sequence is known, see BrowserBatch) with a one-line note, " + "and lean on the plan already in context instead of re-explaining it. Re-plan out loud " + "ONLY when the page clearly contradicts your plan. Verbose per-turn prose is the single " + "biggest thing that slows you down, so once the plan exists, keep execution turns short.\n\n" + "## Required output structure: ReportProgress before every action\n" "Before ANY action tool (BrowserClick, BrowserType, BrowserNavigate, " "BrowserPressKey, BrowserScroll, BrowserEvaluate, BrowserClickIndex, " @@ -476,6 +488,10 @@ SYSTEM_PROMPT = ( "- evaluation_previous: did your last action work? what changed on the page?\n" "- working_memory: what have you learned about this site? what worked, what didn't?\n" "- next_goal: what specifically are you trying to do with the next action?\n" + "After your first planning turn, keep all three fields TELEGRAPHIC, a few words each, " + "not sentences (e.g. evaluation_previous: 'results loaded'; next_goal: 'click result 1'). " + "Only write working_memory when you learn something NEW this turn; otherwise put 'none'. " + "Minimum output per execution turn is the goal, the plan above already carries the detail.\n" "Emit ReportProgress and your action tool(s) together in the same response. " "If you skip ReportProgress, your action tools will be REJECTED with an error " "and you will have to retry. This is not optional. Read-only tools "