diff --git a/apps/desktop/src/main/browser-agent/post-action-observation.test.ts b/apps/desktop/src/main/browser-agent/post-action-observation.test.ts index 629bdc29a7b..3938df6c7fb 100644 --- a/apps/desktop/src/main/browser-agent/post-action-observation.test.ts +++ b/apps/desktop/src/main/browser-agent/post-action-observation.test.ts @@ -94,4 +94,25 @@ describe('post-action observation', () => { }) } ) + + it.each([ + 'browser_click_at', + 'browser_insert_text', + 'browser_select_option', + 'browser_set_checked', + 'browser_drag', + ] as const)('observes after %s instead of refusing the call', async (tool) => { + await expect( + withPostActionObservation( + tool, + { observe: {} }, + async () => ({ dispatched: true }), + async () => ({ outline: 'After' }), + () => {} + ) + ).resolves.toMatchObject({ + dispatched: true, + observation: { ok: true, result: { outline: 'After' } }, + }) + }) }) diff --git a/apps/desktop/src/main/browser-agent/post-action-observation.ts b/apps/desktop/src/main/browser-agent/post-action-observation.ts index b00b94f7b2b..456a47f6cb8 100644 --- a/apps/desktop/src/main/browser-agent/post-action-observation.ts +++ b/apps/desktop/src/main/browser-agent/post-action-observation.ts @@ -3,13 +3,19 @@ import { getErrorMessage } from '@sim/utils/errors' import { isRecordLike } from '@sim/utils/object' import { ToolError } from '@/main/browser-agent/errors' +/** Every page action accepts observe: models carry it over from click and type to the rest. */ const OBSERVABLE_ACTIONS: ReadonlySet = new Set([ 'browser_click', + 'browser_click_at', 'browser_type', + 'browser_insert_text', 'browser_press_key', 'browser_fill_form', + 'browser_select_option', + 'browser_set_checked', 'browser_scroll', 'browser_hover', + 'browser_drag', 'browser_batch', ])