From 725578b2a8248f96b1de074daecdb03ca1ccf79f Mon Sep 17 00:00:00 2001 From: ciregenz Date: Sun, 7 Jun 2026 23:44:39 -0700 Subject: [PATCH] [eric] browser: orchestrator translates the OUTCOME line into a plain human confirmation; drop hardcoded task-specific examples from prompts --- backend/apps/agents/browser/browser_schema.py | 12 +++++++----- .../apps/agents/manager/prompt/prompt_context.py | 14 +++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/backend/apps/agents/browser/browser_schema.py b/backend/apps/agents/browser/browser_schema.py index b27494d7..76c19151 100644 --- a/backend/apps/agents/browser/browser_schema.py +++ b/backend/apps/agents/browser/browser_schema.py @@ -409,9 +409,10 @@ BROWSER_TOOLS_SCHEMA = [ "type": "string", "description": ( "Optional. A specific button label, visible text, or CSS selector " - "you expect to appear (e.g. 'Haik Decie', 'Write a message', " - "'button[type=submit]'). The wait ends the moment it's present and " - "visible. Be specific, not a generic word like 'Message'." + "you expect to appear (e.g. the person's name you searched, a " + "placeholder like 'Write a message', or 'button[type=submit]'). The " + "wait ends the moment it's present and visible. Be specific, not a " + "generic word like 'Message'." ), }, }, @@ -795,8 +796,9 @@ SYSTEM_PROMPT = ( "line: 'OUTCOME: DONE - ' or 'OUTCOME: NOT DONE - '. The parent agent decides whether to re-dispatch another browser " "from that line alone, so a vague or missing outcome line costs a whole redundant " - "agent run. For irreversible actions, DONE requires the proof you observed " - "(e.g. 'message visible in thread at 9:31 PM'). Keep the rest of the summary brief." + "agent run. For irreversible actions, DONE requires the proof you observed: the exact " + "thing now on the page that confirms it, and where or when you saw it. Keep the rest " + "of the summary brief." ) MAX_TURNS = 40 diff --git a/backend/apps/agents/manager/prompt/prompt_context.py b/backend/apps/agents/manager/prompt/prompt_context.py index 09cfd614..5585846e 100644 --- a/backend/apps/agents/manager/prompt/prompt_context.py +++ b/backend/apps/agents/manager/prompt/prompt_context.py @@ -139,12 +139,16 @@ def _build_browser_context(dashboard_id: str | None, selected_browser_ids: list[ "and faster than spawning one agent per item with BrowserAgents, use parallel " "BrowserAgents only for genuinely DIFFERENT tasks, not for the same flow repeated.", "", - "**Trust the agent's OUTCOME line; don't redo its work or re-narrate it.** " + "**Trust the agent's OUTCOME line for your DECISION; TRANSLATE it for the user.** " "Every browser agent result ends with 'OUTCOME: DONE - ' or 'OUTCOME: NOT " - "DONE - '. DONE with proof means complete: reply to the user in 1-2 short " - "sentences passing that proof along, and do NOT dispatch a verification agent. " - "NOT DONE means re-dispatch with a sharper task (start from what the agent " - "reported), not a duplicate of the old one. Long restatements of what the agent " + "DONE - '. That line is internal plumbing for YOU, never show it to the user. " + "DONE with proof means complete: confirm it to the user the way a helpful person " + "would, one short natural sentence saying what got done plus the human-meaningful " + "proof from the result (the name, the time, the title). NEVER echo the literal " + "'OUTCOME:' tag or the agent's UI mechanics (composer, textbox, element indices, " + "'value now empty'), those mean nothing to a user; and do NOT dispatch a " + "verification agent. NOT DONE means re-dispatch with a sharper task (start from " + "what the agent reported), not a duplicate. Long restatements of what the agent " "already said just slow the user down.", ]