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
Open
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On a default macOS machine, the Python worker never starts. The TUI reports the opaque:
(and any browser task silently does nothing).
Root cause
PythonWorker::start_with_default_runtimelaunches the worker with:There's no
--pythonconstraint, souvresolves 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.5declaresrequires-python >= 3.11, so resolution fails:uvexits non-zero before the worker prints its first line, andread_response_linesurfaces that aspython worker exited before responding.Fix
Add
--python ">=3.11"to theuv runargs.uvwill reuse any compatible interpreter already on the machine, or fetch a managed one. No behavior change on hosts that already resolve to >= 3.11.Verification
cargo test -p browser-use-python-worker→ 11 passed, 0 failed.uv run --with cdp-use==1.4.5 ... python ...from$HOME→ resolution error (3.9.6).uv run --python ">=3.11" --with cdp-use==1.4.5 ... python ...→ selects 3.11.x (managed fetch if needed), worker responds{"ok":true,...}, andbrowser diagnosticsreportsbrowser_harness: available.Notes / possible follow-ups
python3with no--with) has the same latent version assumption, but it already depends on a fully provisioned interpreter, so it's out of scope here.read_response_lineswallowing the child's stderr is what made this hard to diagnose — surfacinguv'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 runto 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.uvnow reuses a compatible interpreter or fetches one, satisfyingcdp-use’srequires-python >= 3.11with no behavior change on hosts already at >=3.11.Written for commit d96c69a. Summary will update on new commits.