Skip to content

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

Draft
shrey150 wants to merge 8 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 8 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 carrying a permanently unsupported V4 compatibility flag. This is also the first stack head with the complete supported V3 CLI surface on Stagehand V4, so the Browse minor-release changeset belongs here.

  • 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.
  • Add the single minor changeset for the V4 migration and contract removal.

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

Stack (#2872)

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

Review boundary

The diff from #2849 is intentionally small: one public-contract removal plus its release metadata. Browser lifecycle, standard commands, cursor, and network are proven independently below it. #2838 consumes this publishable parity head but no longer owns the migration changeset.

Current-head E2E matrix

The actual built CLI implementation now on final head 4d58e50223 was run against a deterministic page in a real Browserbase browser:

Flow Observed result
Open/status Connected and initialized in remote mode
CSS + XPath reads Both resolved; XPath <h1> returned Ready
Fill/select/click/is Ada, option b, checkbox checked, result Clicked
Highlight/wait/viewport/screenshot Completed; screenshot was 9,391 bytes
Tabs Count changed 1 → 2 → 1
Coordinate command help --return-xpath absent from click/hover/scroll/drag
Attempt removed flag Exit 2: Nonexistent flag: --return-xpath
Stop Remote session cleaned up

The inherited network implementation was also rerun on this stack shape: actual V3 and V4 built CLIs each emitted 8 request/7 response artifacts with command diffs [], matching evaluation results, and 0 normalized artifact differences. The real Browserbase two-cycle sidecar test also passed.

  • pnpm --filter browse lint: passed.
  • pnpm --filter browse test: 27 files / 383 tests passed.
  • Changeset status reports browse as a minor bump.

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4d58e50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
browse Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another 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