Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Compact prompt: ask for a missing value with clarify

Claude0d64f60d9648
diff --git a/src/chrome/src/agent/tools.js b/src/chrome/src/agent/tools.js
index f6bd4dd04..0f509242d 100644
--- a/src/chrome/src/agent/tools.js
+++ b/src/chrome/src/agent/tools.js
@@ -2539,7 +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.
+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), ask with clarify({question, options}) before filling or opening anything; never choose one yourself. For a recipient, use purpose message_recipient.
${SENSITIVE_PAGE_DATA_GUIDANCE}
diff --git a/src/firefox/src/agent/tools.js b/src/firefox/src/agent/tools.js
index 93a242442..c85cd2850 100644
--- a/src/firefox/src/agent/tools.js
+++ b/src/firefox/src/agent/tools.js
@@ -2009,7 +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.
+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), ask with clarify({question, options}) before filling or opening anything; never choose one yourself. For a recipient, use purpose message_recipient.
${SENSITIVE_PAGE_DATA_GUIDANCE}
diff --git a/test/prompt-missing-values.mjs b/test/prompt-missing-values.mjs
index 03b251a61..5046b1d00 100644
--- a/test/prompt-missing-values.mjs
+++ b/test/prompt-missing-values.mjs
@@ -13,11 +13,14 @@ 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`, () => {
+ // The compact tier has the clarify tool, so it pauses for the answer instead of ending the run.
+ test(`${build}: the compact Act prompt asks for a missing value with clarify 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/);
- });
+ assert.match(prompt, /ask with clarify\(\{question, options\}\) before filling or opening anything; never choose one yourself/);
+ assert.match(prompt, /purpose message_recipient/);
+ assert.doesNotMatch(prompt.match(/Type only values[^\n]*/)[0], /done\(/);
+ const names = tools.getToolsForMode('act', { tier: 'compact' }).map(tool => tool.function.name);
+ assert.ok(names.includes('clarify'), 'compact exposes clarify');
+});
}