Skip to content

v0.9.1: browser agent improvements - #8294

Merged
waleedlatif1 merged 1 commit into
mainfrom
staging
Sep 25, 2026
Merged

waleedlatif1 merged 1 commit into
mainfrom
staging

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

…imed pointer paths (#8291)

* fix(browser): keep the agent tab composited when no panel shows it

A tab view that is in no window has no compositor surface, so CDP mouse input on it never acknowledges and screenshots never capture. The agent's tab was left that way whenever the user viewed another tab or had not opened the browser panel: clicks failed or stalled five seconds and screenshots failed. Each chat's agent tab is now parked invisibly in the main window, adopted in place when the panel shows it, and released on every tab teardown path.

* improvement(browser): name the controls a refused click can use next

A click refused because an overlay covers the target now lists the overlay's own snapshot controls, so the agent dismisses it and retries the same id without another snapshot. A click that lands on a nested control names that control's id. Only real overlays (dialogs, modals, fixed or sticky layers) list controls.

* feat(browser): route drags and coordinate hovers along timed pointer paths

browser_drag takes optional via points and a durationMs, and browser_hover can target a viewport point with the same route, moving with no button pressed. Pages that react to pointer speed or position (sliders, physics, canvas hover, cursor-following games) can now be driven the way Claude computer use and OpenAI's CUA allow. A plain drag keeps its exact previous pace; batches refuse timed paths so they cannot outlast the batch watchdog.

* fix(browser): honor cancellation on pointer routes and keep agent tabs tracked across scopes

- Timed drags and hover routes stop as soon as their tool call is cancelled;
  a drag still releases the button through its existing cleanup.
- A coordinate hover refuses durationMs without via points instead of
  silently moving straight to the target.
- A scope migration carries the chat's agent tab registration with it, so the
  migrated chat's old agent tab is released when it switches tabs.
- Overlay controls are found through shadow roots and with any tag casing.

* fix(browser): cancel drags during their settle and keep parked agent tabs in the main window

- An already-aborted drag sends no input, and an abort during the settle hold
  takes the cancellation cleanup instead of dropping.
- A coordinate hover re-checks the active tab right before it moves.
- Parking an agent tab hands keyboard focus back to whichever of the Sim
  renderer or the visible page held it.
- An agent tab detached from a secondary window is parked in the main window,
  which outlives it.
- A framed target covered by a parent-page overlay lists that overlay's controls.

* fix(browser): refuse a coordinate hover across a navigation

The coordinate hover captures the navigation epoch before its page probes and rejects a cross-document navigation before moving the pointer, as browser_click_at and browser_drag do. The overlay helper skips the empty registry slots earlier snapshots leave.
@vercel

vercel Bot commented Sep 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 25, 2026 9:11am UTC

Request Review

@waleedlatif1 waleedlatif1 changed the title v0.9.1: browser agent v0.9.1: browser agent improvements Sep 25, 2026
@waleedlatif1
waleedlatif1 merged commit ab2fe4a into main Sep 25, 2026
49 of 50 checks passed
@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Sep 25, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into main yet (aggregated across the feature PRs in this release). Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

  • ⚠️ simstudioai/mothership#528 — merged into staging (this PR targets main) — feat(browser): timed pointer paths and REAL harness fidelity

@greptile-apps

greptile-apps Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 3/5

[Medium risk] Adds pointer path routing to browser automation tools.

The PR should not merge until routed hover stops at navigation and cancelled drag setup cannot dispatch a late press.

Findings

  1. P1 Hover continues after navigation ▶

Summary

This PR keeps browser-agent tabs composited while hidden, adds routed drag and coordinate-hover actions, and gives the agent more useful overlay-control references. The routed hover and cancellation paths need safeguards before merge.

Diagram
sequenceDiagram
  participant Driver
  participant CDP
  participant Page
  Driver->>CDP: Move pointer along hover route
  loop Each route point
    CDP->>Page: Dispatch mouse move
    Page-->>Driver: May navigate to a new document
  end
  CDP-->>Driver: Route complete
  Driver->>Page: Read effect
  Note over Driver,Page: Recheck the original navigation epoch before continuing or reporting success
Loading

Reviews (1) · Last reviewed commit: "fix(browser): composite background agent..."

const beforeElement = await activeElementState(contents)
assertCurrentExecution()
assertActiveContents(contents, hoverNavigationEpoch)
await cdp.movePointer(contents, path, { x, y }, signal)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Hover continues after navigation If a routed hover triggers a cross-document navigation at an intermediate point, the navigation check is not repeated after movement starts. Later mouse events can reach the new page, and the tool can report a successful hover using observations from a different document. Stop the route when the original page changes and check again before reporting the result.

@greptile-apps

greptile-apps Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff

These findings sit on lines the diff does not cover, so they could not be posted inline. Each one leaves this list once its file changes.

  • P1 Cancelled drag still presses apps/desktop/src/main/browser-agent/cdp.ts:1204 ▶

    If cancellation occurs while drag setup or pointer positioning is awaiting a CDP command, the initial abort check has already passed. When that command finishes, this code still presses the button and sends the first drag move, injecting input after the caller has been told the action stopped. Check the signal again before pressing.

      try {
        signal?.throwIfAborted()
        pressed = true
        await sendInput(contents, 'Input.dispatchMouseEvent', {
    

This branch was previously deployed

1 inactive deployment
Preview — e6badaf6 Deployed Sep 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant