Skip to content

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

Ignore non-committing receipts when choosing the deletion caveat

Claude1e936acfa147
diff --git a/src/chrome/src/agent/agent.js b/src/chrome/src/agent/agent.js
index 587b8f558..af02dc0d4 100644
--- a/src/chrome/src/agent/agent.js
+++ b/src/chrome/src/agent/agent.js
@@ -40892,12 +40892,14 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
// dispatched. A dispatched deletion is also the current submit receipt
// (_recordCompletionSubmitState keeps both), so that receipt is fine; a
// later ordinary form submission replaces it with one that is not a
- // deletion and leaves no resource-mutation record of its own.
+ // deletion and leaves no resource-mutation record of its own. A
+ // non-committing form (a GET search that checks the item is gone) also
+ // replaces the receipt but dispatches no second mutation, so it is ignored.
const currentReceipt = missingRequiredSubmission ? this._currentCompletionSubmitState(tabId) : null;
const missingDeletion = missingRequiredSubmission
&& Array.isArray(state.resourceMutationDispatches) && state.resourceMutationDispatches.length > 0
&& state.resourceMutationDispatches.every(attempt => attempt?.mutationKind === 'delete')
- && (currentReceipt?.dispatched !== true || currentReceipt.mutationKind === 'delete');
+ && (currentReceipt?.dispatched !== true || currentReceipt.mutationKind === 'delete' || currentReceipt.nonCommitting === true);
const advisory = this._planGuardAdvisory(tabId, state, { viaDone, looksPlanOnly, runtimeModeContradiction,
structuredPlan: structuredPlan
|| (state.allowsPlannerShapedResult !== true && this._isPlannerShapedJson(content)),
diff --git a/src/firefox/src/agent/agent.js b/src/firefox/src/agent/agent.js
index b02f6fa97..d1d1bc5b3 100644
--- a/src/firefox/src/agent/agent.js
+++ b/src/firefox/src/agent/agent.js
@@ -37635,12 +37635,14 @@ Rules: no prose intro, no conclusion, no "this screenshot shows...", no layout d
// dispatched. A dispatched deletion is also the current submit receipt
// (_recordCompletionSubmitState keeps both), so that receipt is fine; a
// later ordinary form submission replaces it with one that is not a
- // deletion and leaves no resource-mutation record of its own.
+ // deletion and leaves no resource-mutation record of its own. A
+ // non-committing form (a GET search that checks the item is gone) also
+ // replaces the receipt but dispatches no second mutation, so it is ignored.
const currentReceipt = missingRequiredSubmission ? this._currentCompletionSubmitState(tabId) : null;
const missingDeletion = missingRequiredSubmission
&& Array.isArray(state.resourceMutationDispatches) && state.resourceMutationDispatches.length > 0
&& state.resourceMutationDispatches.every(attempt => attempt?.mutationKind === 'delete')
- && (currentReceipt?.dispatched !== true || currentReceipt.mutationKind === 'delete');
+ && (currentReceipt?.dispatched !== true || currentReceipt.mutationKind === 'delete' || currentReceipt.nonCommitting === true);
const advisory = this._planGuardAdvisory(tabId, state, { viaDone, looksPlanOnly, runtimeModeContradiction,
structuredPlan: structuredPlan
|| (state.allowsPlannerShapedResult !== true && this._isPlannerShapedJson(content)),
diff --git a/test/guard-advisory-completion.mjs b/test/guard-advisory-completion.mjs
index 451354503..83a626997 100644
--- a/test/guard-advisory-completion.mjs
+++ b/test/guard-advisory-completion.mjs
@@ -1026,6 +1026,14 @@ for (const build of ['chrome', 'firefox']) {
h.agent._completionSubmitStates.set(h.tab, { dispatched: true, mutationKind: 'delete', actionSequence: 3, taskKey: guard.taskKey });
}), { summary: 'Deleted the post.', outcome: 'success' }, 'I couldn\'t confirm that the deletion took effect.', `${build} deletion`);
+ // A non-committing form after the deletion (a GET search that checks the item is gone)
+ // replaces the receipt but is not a second mutation: the deletion is still the unverified action.
+ await refusedOnceThenAccepted(Agent, planCase({ requiresStateChange: true, requiresSubmission: true }, (guard, h) => {
+ guard.successfulConsequentialToolCalls = 1; guard.successfulTaskToolCalls = 1; guard.evidenceTaskKey = guard.taskKey;
+ guard.resourceMutationDispatches = [{ mutationKind: 'delete', resourceUrl: 'https://mastoturk.org/@owned/1', actionSequence: 3 }];
+ h.agent._completionSubmitStates.set(h.tab, { dispatched: true, nonCommitting: true, mutationKind: 'submit', actionSequence: 4, taskKey: guard.taskKey });
+ }), { summary: 'Deleted the post.', outcome: 'success' }, 'I couldn\'t confirm that the deletion took effect.', `${build} deletion then search`);
+
// With an ordinary form submission also dispatched, the unverified action
// may be that submission, so the deletion wording is not used.
await refusedOnceThenAccepted(Agent, planCase({ requiresStateChange: true, requiresSubmission: true }, (guard, h) => {