Skip to content

fix(python-worker): pin uv run to Python >=3.11 so the worker starts on stock macOS#34

Open
zaydiscold wants to merge 1 commit into
browser-use:mainfrom
zaydiscold:fix/python-worker-pin-uv-python-3.11
Open

fix(python-worker): pin uv run to Python >=3.11 so the worker starts on stock macOS#34
zaydiscold wants to merge 1 commit into
browser-use:mainfrom
zaydiscold:fix/python-worker-pin-uv-python-3.11

Conversation

@zaydiscold
Copy link
Copy Markdown

@zaydiscold zaydiscold commented Jun 2, 2026

Problem

On a default macOS machine, the Python worker never starts. The TUI reports the opaque:

Error: python worker exited before responding

(and any browser task silently does nothing).

Root cause

PythonWorker::start_with_default_runtime launches the worker with:

uv run --quiet --with cdp-use==1.4.5 --with fetch-use==0.4.0 --with pillow==12.2.0 python -m llm_browser_worker.worker

There's no --python constraint, so uv resolves an interpreter by discovery order. On a stock macOS box that's Apple's frozen /usr/bin/python3 (3.9.6). cdp-use==1.4.5 declares requires-python >= 3.11, so resolution fails:

× No solution found when resolving `--with` dependencies:
╰─▶ Because the current Python version (3.9.6) does not satisfy Python>=3.11
    and cdp-use==1.4.5 depends on Python>=3.11 ...

uv exits non-zero before the worker prints its first line, and read_response_line surfaces that as python worker exited before responding.

Fix

Add --python ">=3.11" to the uv run args. uv will reuse any compatible interpreter already on the machine, or fetch a managed one. No behavior change on hosts that already resolve to >= 3.11.

let args = [
    "run",
    "--quiet",
    "--python",
    ">=3.11",
    "--with", "cdp-use==1.4.5",
    ...
];

Verification

  • cargo test -p browser-use-python-worker → 11 passed, 0 failed.
  • Before: uv run --with cdp-use==1.4.5 ... python ... from $HOME → resolution error (3.9.6).
  • After: uv run --python ">=3.11" --with cdp-use==1.4.5 ... python ... → selects 3.11.x (managed fetch if needed), worker responds {"ok":true,...}, and browser diagnostics reports browser_harness: available.

Notes / possible follow-ups

  • The fallback path (python3 with no --with) has the same latent version assumption, but it already depends on a fully provisioned interpreter, so it's out of scope here.
  • Separately, read_response_line swallowing the child's stderr is what made this hard to diagnose — surfacing uv's stderr on a non-zero exit would turn "exited before responding" into the actual resolver error. Happy to send that as a second PR if useful.

Summary by cubic

Pin uv run to Python >=3.11 (--python ">=3.11") when launching the Python worker so it starts on stock macOS and avoids the "python worker exited before responding" error. uv now reuses a compatible interpreter or fetches one, satisfying cdp-use’s requires-python >= 3.11 with no behavior change on hosts already at >=3.11.

Written for commit d96c69a. Summary will update on new commits.

Review in cubic

…s on stock macOS

The Python worker is launched with `uv run --with cdp-use==1.4.5 ...` but without a
`--python` constraint. uv then resolves an interpreter by discovery order, which on a
default macOS box is Apple's frozen /usr/bin/python3 (3.9.6). cdp-use's
`requires-python >= 3.11` cannot be satisfied, so uv exits before the worker prints
anything and the only symptom the user sees is the opaque
"python worker exited before responding" from read_response_line.

Add `--python ">=3.11"` to the uv args so uv reuses any compatible interpreter already
on the machine or fetches a managed one. No behavior change on hosts that already
resolve to >=3.11.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

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