fix: support Windows preset launchers#172
Open
jamiechicago312 wants to merge 1 commit into
Open
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
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.
Summary
.venv/Scripts/python.exesetup.shfall back topythonorpy -3whenpython3is unavailableWhy this is required for native Windows local mode
On native Windows, preset runs can fail before the prompt even starts when the generated automation assumes Unix/POSIX launcher conventions:
.venv/bin/python main.pydoes not exist on a Windows virtualenv (.venv\Scripts\python.exedoes)pythonand/orpy, but not apython3shimThat failure path surfaces as
exit_code=127(command not found), which in turn can trip stale-run recovery and create duplicate recovery runs. For Slack Channel Monitor, that can mean two "On it!" links / two conversations for one Slack message.Dependency / downstream impact
This is the permanent upstream fix for one of the Windows blockers currently being shimmed in OpenHands/agent-canvas#1257.
I verified that by reviewing
tools/automation-sitecustomize/sitecustomize.pyin #1257: it currently patchesOpenHands/automationat dev time to add exactly these two fallbacks:python3 -> python -> py -3.venv/bin/python -> .venv/Scripts/python.exeSo:
OpenHands/automationitself and to remove that shim debt from the downstream stackTesting
uv run pytest tests/test_preset_router.py -quv run ruff check openhands/automation/preset_router.py tests/test_preset_router.pybash -n openhands/automation/presets/prompt/setup.shbash -n openhands/automation/presets/plugin/setup.shCloses #171.
This PR description was updated by an AI agent (OpenHands) on behalf of the user.