Skip to content

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

Drop the planner's deliverables when the person edited the approved plan

Claude20271e7492f9
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 016adb3fc..7a4f6a215 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -28459,8 +28459,10 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
requiresStateChange: approvedRequiresStateChange,
requiresSubmission: approvedRequiresSubmission,
readScope: approvedReadScope,
- deliverables: this._plannerCompletionGateFields(plan).deliverables,
- multipleDeliverables: this._plannerCompletionGateFields(plan).multipleDeliverables,
+ // The reviewed text is not parsed for deliverables, so an edit drops the
+ // planner's list instead of enforcing what the person may have removed.
+ deliverables: approvedPlanEdited ? [] : this._plannerCompletionGateFields(plan).deliverables,
+ multipleDeliverables: approvedPlanEdited ? false : this._plannerCompletionGateFields(plan).multipleDeliverables,
siteWorkflowUrl: tabUrl,
messaging: approvedPlanEdited ? null : plan.messaging,
requestedMessaging: approvedPlanEdited ? null : plan.requested_messaging,
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index 3f5dcf2d7..a6b77b859 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -25490,8 +25490,10 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
requiresStateChange: approvedRequiresStateChange,
requiresSubmission: approvedRequiresSubmission,
readScope: approvedReadScope,
- deliverables: this._plannerCompletionGateFields(plan).deliverables,
- multipleDeliverables: this._plannerCompletionGateFields(plan).multipleDeliverables,
+ // The reviewed text is not parsed for deliverables, so an edit drops the
+ // planner's list instead of enforcing what the person may have removed.
+ deliverables: approvedPlanEdited ? [] : this._plannerCompletionGateFields(plan).deliverables,
+ multipleDeliverables: approvedPlanEdited ? false : this._plannerCompletionGateFields(plan).multipleDeliverables,
siteWorkflowUrl: tabUrl,
messaging: approvedPlanEdited ? null : plan.messaging,
requestedMessaging: approvedPlanEdited ? null : plan.requested_messaging,
diff --git a/test/planner-repair-authority.mjs b/test/planner-repair-authority.mjs
index b300ba087..7314824b2 100644
--- a/test/planner-repair-authority.mjs
+++ b/test/planner-repair-authority.mjs
@@ -830,4 +830,25 @@ for (const browser of ['chrome', 'firefox']) {
assert.ok(gate.approvedScratchpadText.includes('বাংলা'));
}
});
+
+ test(`${browser}: an edited approved plan no longer carries the planner's deliverables`, async () => {
+ for (const edit of [false, true]) {
+ const provider = { promptTier: 'full', model: 'neutral-planner-display-test', name: 'neutral-planner-display-test' };
+ const agent = new Agent({ getActive: () => provider, getVisionProvider: async () => null });
+ agent.setPlanReviewSettings({ mode: 'always' });
+ agent._chatWithCostAllowance = async () => ({ content: JSON.stringify(modelPlan({ deliverables: ['The first result', 'The second result'] })) });
+ agent._waitForPlanReview = async (_tabId, _planId, plan, compact, _update, verbose) => {
+ const editedText = verbose.replace(plan.steps[0].action, 'Read the page and report only the first result.');
+ if (!edit) return { action: 'approve' };
+ const dataset = { planDirty: 'true', planEditSource: 'raw', editedText, planMarkdownMode: 'verbose', originalCompactMarkdown: compact };
+ return { action: 'approve', ...review.approval({ dataset: JSON.parse(JSON.stringify(dataset)), querySelector: () => null }) };
+ };
+ const gate = await agent._runPlannerGate(42, { role: 'user', content: 'Read the current owned page without changing it.' },
+ () => {}, null, null, '', { tabUrl: 'https://example.test/owned', tabTitle: 'Owned neutral page' },
+ 'try', 'act', { locale: 'en' });
+ assert.equal(gate.proceed, true, JSON.stringify(gate));
+ assert.equal(gate.multipleDeliverables, !edit, `${browser}: edited=${edit}`);
+ assert.deepEqual(gate.deliverables, edit ? [] : ['The first result', 'The second result']);
+ }
+ });
}