Skip to content

refactor(cli): remove coordinate XPath return flag - #2835

Draft
shrey150 wants to merge 4 commits into
agent/browse-v4-network-sidecarfrom
agent/browse-v4-5-remove-xpath
Draft

refactor(cli): remove coordinate XPath return flag#2835
shrey150 wants to merge 4 commits into
agent/browse-v4-network-sidecarfrom
agent/browse-v4-5-remove-xpath

Conversation

@shrey150

@shrey150 shrey150 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove Browse's obsolete --return-xpath coordinate-action option instead of retaining a permanently unsupported V4 compatibility flag.

  • Remove the option from mouse click, hover, scroll, and drag.
  • Stop sending or accepting returnXPath in driver payloads.
  • Remove obsolete examples and README guidance.
  • Assert that the option is absent from all four command help surfaces.

XPath selectors and snapshot xpathMap are unchanged. This removes only the request to return an XPath from a raw coordinate action.

Stack

  1. chore(cli): import Browse V3 baseline #2833 — exact Browse V3 baseline import
  2. refactor(cli): migrate Browse runtime to Stagehand V4 #2834 — Stagehand V4 runtime cutover and CLI-owned cursor
  3. fix(cli): restore V3 network capture through a CDP sidecar #2849 — CLI-private CDP sidecar; restores V3 network capture
  4. refactor(cli): remove coordinate XPath return flag #2835 — remove --return-xpath; complete supported V3 parity
  5. test(evals): exercise the workspace V4 CLI #2838 — eval, packaging, and release wiring
  6. fix(cli): persist context names in Browserbase #2839 — managed Context names (fast-follow)
  7. refactor(cli): consume shared Functions core #2701 — shared Functions core consumer (fast-follow)

Review boundary

The diff from #2849 is intentionally small and is a public-contract removal only. #2834 proves the V4 runtime, #2849 restores network capture, and this PR proves that all supported V3 behavior remains after deleting the sole unsupported option.

E2E Test Matrix

All flows below used the actual built CLI against real local Chromium on this PR.

Command / flow Observed output Confidence / sufficiency
Open/status/snapshot full and refs; CSS, XPath, and ref fill/click Final form output Hello CompleteParity Proves selector/action parity remains after the flag removal
get and is getters; checkbox/select/upload/highlight All value, visibility, checked, and file assertions passed Covers element state and non-text actions
Keyboard bare/delay/mistakes; press Bare type succeeded and all variants produced expected text Protects the V4 input path from regression
Cursor plus raw mouse input The original feature-head E2E moved the CLI-owned evaluated cursor to 137px, 149px; that implementation is unchanged by the restack Proves coordinate commands still work after their flag schema changed and without a core cursor API
Screenshot; wait selector and timeout; back/forward/reload Artifact and navigation assertions passed Covers page-control parity
Actual built V3 CLI vs actual built parity-head CLI network differential 8 requests / 7 responses each; command diffs []; flow result matched; 0 normalized JSON/file-mode differences Proves #2849 network behavior remains V3-compatible at the full-parity head
Tabs new/list/switch/close Active tab and counts matched Proves context/page behavior remains intact
Built CLI help plus mouse click --return-xpath on current head Flag absent from help; command exited 2 with Nonexistent flag: --return-xpath Proves the unsupported public flag is actually removed
Built CLI XPath selector (get text /html/body/div/h1) plus retained snapshot coverage XPath command exited 0; snapshot xpathMap tests passed Proves XPath support itself was not removed
Stop then status Disconnected Proves cleanup at the full-parity head
Browse build/lint/full suite on current restacked head 27 files / 382 tests passed; Prettier, ESLint, and TypeScript passed Broad regression coverage including the sidecar

This is the first stack head with the complete supported V3 CLI surface running on V4 and no intentionally failing compatibility option.

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9a32bea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

…-remove-xpath

# Conflicts:
#	packages/cli/tests/driver-commands.test.ts
@shrey150
shrey150 changed the base branch from agent/browse-v4-4-runtime to agent/browse-v4-network-sidecar August 28, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant