{{ message }}
Repository navigation
Conversation
`sweagent run-api` was advertised in the CLI help and accepted by argparse, but its dispatch imports `sweagent.api.server`, which does not exist anywhere in the package, so every invocation crashed with ModuleNotFoundError. Remove the dead help entry, argparse choice, and dispatch branch, and add a regression test that dispatches --help for every accepted subcommand.
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
Fixes #1602
What does this implement/fix? Explain your changes.
Summary
sweagent run-apiwas advertised in the CLI help and accepted by argparse, but every invocation crashed with a raw traceback:Why (root cause)
The dispatch branch in
sweagent/run/run.py(elif command == "run-api":→from sweagent.api.server import run_from_cli as run_api_main, run.py:105-108 before this change) imports a module that does not exist anywhere in the package:sweagent/contains onlyagent,environment,exceptions.py,inspector,run,tools,types.pyandutils, andpyproject.tomldefines no optional extra providing it. The advertised subcommand therefore could never start.Changes
sweagent/run/run.py: remove the deadrun-apientry from the CLI help docstring, from thecommandchoices inget_cli(), and from the dispatch inmain().tests/test_run.py: add a regression test that dispatches--helpfor every subcommand accepted byget_cli()and asserts each exits cleanly instead of raising, so a dispatch to a missing module cannot be reintroduced unnoticed.After this change
sweagent run-apiis rejected by argparse with the standardinvalid choice: 'run-api'usage error (exit code 2), andsweagent --helpno longer advertises it.Testing
main(3ea751c):pytest tests/test_run.py -q→1 failed, 23 passed, failing intest_cli_subcommand_help_dispatches[run-api]withModuleNotFoundError: No module named 'sweagent.api'atsweagent/run/run.py:106.pytest tests/test_run.py -q→23 passed.26 failed, 122 passed, 3 xfailedmain:26 failed, 102 passed, 3 xfailedFAILEDlists); no new failures.ruff check sweagent/run/run.py tests/test_run.py→All checks passed!ruff format --check sweagent/run/run.py tests/test_run.py→2 files already formatted