Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Add the missing-value rule to the compact Act prompt
Claude4aea432ebaa3
diff --git a/src/chrome/src/agent/tools.js b/src/chrome/src/agent/tools.jsindex b85f1e735..f6bd4dd04 100644--- a/src/chrome/src/agent/tools.js+++ b/src/chrome/src/agent/tools.js@@ -2539,6 +2539,7 @@ RULES:15. CAPTCHA: stop and ask the user to complete verification manually. Never dismiss, close, or resubmit the challenge. Report blocked work with done({outcome:"partial"}).16. Before filling an external email/message/post composer, formulate the exact recipient, subject, and body. For more than a one-line body, save the complete text as \`[pending draft]\` with scratchpad_write first so it can be recovered if the UI fails; never mark it sent until verified.17. Recover incomplete source text with read_page or return to its observed URL. Pending uploads need available waits/reads. Complete independent authorized destinations before done; preserve unresolved submissions/challenges and stop for real blockers, cancellation, or limits.+18. Type only values the user gave or the page already shows. When a needed value has neither (a date, an amount, which of two people with the same name), call done({summary:"...", outcome:"partial"}) asking the user for it instead of choosing one yourself.${SENSITIVE_PAGE_DATA_GUIDANCE}diff --git a/src/firefox/src/agent/tools.js b/src/firefox/src/agent/tools.jsindex b87e5f448..93a242442 100644--- a/src/firefox/src/agent/tools.js+++ b/src/firefox/src/agent/tools.js@@ -2009,6 +2009,7 @@ RULES:15. CAPTCHA: stop and ask the user to complete verification manually. Never dismiss, close, or resubmit the challenge. Report blocked work with done({outcome:"partial"}).16. Before filling an external email/message/post composer, formulate the exact recipient, subject, and body. For more than a one-line body, save the complete text as \`[pending draft]\` with scratchpad_write first so it can be recovered if the UI fails; never mark it sent until verified.17. Recover incomplete source text with read_page or return to its observed URL. Pending uploads need available waits/reads. Complete independent authorized destinations before done; preserve unresolved submissions/challenges and stop for real blockers, cancellation, or limits.+18. Type only values the user gave or the page already shows. When a needed value has neither (a date, an amount, which of two people with the same name), call done({summary:"...", outcome:"partial"}) asking the user for it instead of choosing one yourself.${SENSITIVE_PAGE_DATA_GUIDANCE}diff --git a/test/prompt-missing-values.mjs b/test/prompt-missing-values.mjsindex fdca2798b..03b251a61 100644--- a/test/prompt-missing-values.mjs+++ b/test/prompt-missing-values.mjs@@ -1,4 +1,4 @@-// The Act prompts tell the model to ask for a value the user did not give+// The Act prompts (full, mid, lean and compact) tell the model to ask for a value the user did not give// instead of choosing one: QA G1 filled a booking date nobody named, G2// opened one of two contacts called Alex.import assert from 'node:assert/strict';@@ -13,4 +13,11 @@ for (const build of ['chrome', 'firefox']) {}assert.match(tools.SYSTEM_PROMPT_ACT, /purpose message_recipient/);});+ // The compact tier has no clarify tool: it stops with a partial done and asks.+ test(`${build}: the compact Act prompt asks for a missing value instead of choosing one`, () => {+ const prompt = tools.SYSTEM_PROMPT_ACT_COMPACT;+ assert.match(prompt, /which of two people with the same name/);+ assert.match(prompt, /outcome:"partial"\}\) asking the user for it instead of choosing one yourself/);+ assert.doesNotMatch(prompt.match(/Type only values[^\n]*/)[0], /clarify/);+ });}