Repository navigation
Conversation
`run_from_cli` built the environment config (including the -v <repo>:/repo docker volume mount) before prompting for the repository path, so `sweagent sh` without -r mounted the literal string None instead of the path entered at the prompt.
sun04222
added a commit
to sun04222/SWE-agent
that referenced
this pull request
Oct 23, 2026
This branch has not been deployed
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.
Reference Issues/PRs
No existing issue or PR covers this (searched the tracker for
sweagent sh/ repo prompt / run_shell; the last commit touchingsweagent/run/run_shell.pyis an unrelated typo fix).What does this implement/fix? Explain your changes.
Summary
sweagent shprompts for the repository path when-r/--repois not given, but the prompt ran after the environment config had already been built. Without-rthe docker volume mount therefore became-v None:/repo, and the path entered at the prompt was discarded. This PR moves the prompt above the environment-config construction so the entered path is used.Why
sweagent/run/run_shell.py:101defines-r/--repowithdefault=None.run_from_cliinterpolatedcli_args.repointo the volume mount while buildingEnvironmentConfig(docker_args=["-v", f"{cli_args.repo}:/repo"]).if cli_args.repo is None: cli_args.repo = Path(Prompt.ask(...))block that fills the value in interactive mode sat below theEnvironmentConfig/SWEEnv.from_configcalls, so without-rthe mount was-v None:/repoand the prompted path never reached the environment.-pproblem-statement prompt is already placed before its first use; the repo prompt now follows the same ordering.Changes
sweagent/run/run_shell.py: moved thecli_args.repo is Noneprompt block above theEnvironmentConfigconstruction so the prompted path is interpolated intodocker_args.docker_argsis the only other use ofcli_args.repoin the file.tests/test_run_shell.py(new): regression tests asserting that the repo path from the interactive prompt (and from-r) ends up in the docker args as["-v", "<repo>:/repo"].Testing
main:pytest tests/test_run_shell.py -v→AssertionError: assert ['-v', 'None:/repo'] == ['-v', '<tmp>/myrepo:/repo'](1 failed, 1 passed).pytest tests/test_run_shell.py -v→2 passed.pytest -m "not slow"on this branch:99 passed, 2 xfailed, plus 12 pre-existing environment failures (missingsweagentconsole script on PATH, Docker daemon not running, GitHub API rate limiting) that fail identically on unpatchedmain; the only run-to-run difference is the new regression test failing there.pre-commit run --files sweagent/run/run_shell.py tests/test_run_shell.py→ all hooks pass (ruff, ruff format, typos, trailing whitespace, check-ast, ...).