browser-use icon indicating copy to clipboard operation
browser-use copied to clipboard

Bug: `browser-use --update` still tells the caller to run `uv tool upgrade browser-use`, which upgrades nothing for pinned installs

Open swf1996120 opened this issue 1 week ago • 1 comments

Browser Use Version

ccbdb8095f

Bug Description, Steps to Reproduce, Screenshots

browser-use --update prints an upgrade command to stderr that, according to the code's own comments, doesn't work for the documented install.

Where: browser_use/cli.py:1073

print('browser-use does not update itself: uv tool upgrade browser-use (or pip install -U browser-use).', file=sys.stderr)

What the code does instead:

  • browser_use/update_check.py:56-58 says the upgrade command is deliberately "not uv tool upgrade: it keeps the version pin ... and upgrades nothing". upgrade_command() returns uv tool install browser-use@latest.
  • browser_use/cli.py:1026: HELP already says uv tool install browser-use@latest.
  • browser_use/cli.py:985: quickstart installs with a pin, uv tool install browser-use=={version}. The README does the same. So most uv tool installs have a ==1.0.x pin, and uv tool upgrade keeps it.
  • browser_use/cli.py:811-813: browser-harness's agent-directed update nag is turned off, so browser-use's --update is the path that is supposed to replace it.

So the --update message (cli.py:1072-1074, exit 2) is the only place that still gives the old command.

What this makes the model do:

  1. Install browser-use the documented way (uv tool install browser-use==1.0.x).
  2. A coding agent using the CLI through the skill runs browser-use --update. It may do this because browser-harness has --update.
  3. The agent reads the stderr line and runs uv tool upgrade browser-use.
  4. Because of the pin, nothing is upgraded. The agent stays on the old version and keeps hitting an error that a newer release already fixes. Stopping that loop is the point of the update-check change.

Suggested text for browser_use/cli.py:1073, to match upgrade_command() and HELP:

print('browser-use does not update itself: uv tool install browser-use@latest (or pip install -U browser-use).', file=sys.stderr)

Another option is to build the message from update_check.upgrade_command() so the two can't drift apart again.

Failing Python Code

# CLI, not Python:
#   uv tool install browser-use==<pinned 1.0.x version>
#   browser-use --update        # prints: uv tool upgrade browser-use ...
#   uv tool upgrade browser-use # keeps the pin, upgrades nothing

swf1996120 avatar Nov 20 '26 08:11 swf1996120

Reproduced this on main at ccbdb80. browser-use --update prints uv tool upgrade browser-use (or pip install -U browser-use). to stderr and exits 2, while update_check.upgrade_command() returns uv tool install browser-use@latest for a uv tool install, and the HELP text says the same. I verified the pin behavior the issue describes: uv tool upgrade keeps the ==1.0.x pin, so the printed command upgrades nothing.

Approach: build the --update message from update_check.upgrade_command() so the printed command always matches the install type and cannot drift from the update check again. The two existing tests that pinned the old string are updated to assert the message names the install's real upgrade command and never contains uv tool upgrade browser-use. The telemetry test compares against the scrubbed message, since the event path redacts the home folder. Repro fails before the fix and passes after; the two affected test files pass (235 passed, 13 skipped), ruff check and format clean, pyright clean on cli.py.

I have the fix ready in a PR linked to this issue. Disclosure: I worked on the fix with AI assistance and have reviewed and tested it myself.

saifullah-ai-engineer avatar Nov 20 '26 09:11 saifullah-ai-engineer