You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4024e1f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(desktop): give the page back to the user mid-action, and stay awake until recovered results land
- A browser action now rechecks, right before each input it sends, whether the
user is working in the page: between a batch's steps or during a click's
target probes, the user wins and the action stops before its next input.
- The wait for the user is bounded inside the action's own deadline. A user
who keeps working gets the model a clear "not run" instead of a timeout with
an unknown outcome.
- The user's activity belongs to the tab they acted in. Once the agent drives
another tab (the old one closed or replaced, the session reopened), it no
longer holds anything up.
- Results a previous app run left behind keep the machine awake until Sim has
them, like a running call's.
Copy file name to clipboardExpand all lines: apps/desktop/src/main/browser-agent/driver.ts
+37-8Lines changed: 37 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5096,6 +5096,12 @@ function withNotices(result: unknown): unknown {
5096
5096
5097
5097
/** Quiet time after the user's last click or keystroke before the agent takes the page back. */
5098
5098
constUSER_TAKEOVER_IDLE_MS=4_000
5099
+
/** The longest an action waits for the user to finish; past it, the action does not run. */
5100
+
constUSER_TAKEOVER_MAX_WAIT_MS=30_000
5101
+
constUSER_KEPT_WORKING=
5102
+
'Not run: the user kept working in this page, so this browser action never started and nothing was sent to the page. Ask the user whether they are done before acting in this page again.'
5103
+
constUSER_TOOK_OVER_MID_ACTION=
5104
+
'Stopped: the user started working in this page, so this browser action stopped before sending its next input. Earlier steps may have taken effect; inspect the page before continuing.'
5099
5105
5100
5106
functionisUserWorkingInPage(): boolean{
5101
5107
constsince=session.msSinceUserIntervention()
@@ -5107,14 +5113,25 @@ function isUserWorkingInPage(): boolean {
5107
5113
* or scrolling in the tab the agent drives, the agent's next action waits, marked as needing
5108
5114
* attention, and resumes once the user has left the page alone for a few seconds.
0 commit comments