Skip to content

fix(run): pass the startup_command as a dict to env.execute() function. - #880

Merged
klieret merged 1 commit into
SWE-agent:mainfrom
Ethan-Kuang-6666:fix/env-startup-command-dict
Jun 29, 2026
Merged

klieret merged 1 commit into
SWE-agent:mainfrom
Ethan-Kuang-6666:fix/env-startup-command-dict

Conversation

@Ethan-Kuang-6666

Copy link
Copy Markdown
Contributor

Summary

The get_sb_environment() function in swebench.py is used whenever an environment is needed while running benchmarks. If there exist environment startup commands, they will be passed to the env.execute() function to get executed. However, the env.execute() function expects the commands to be passed as a dict, and in current version the startup_command is passed as a string. An AttributeError will be thrown.

The Fix

startup_command is not wrapped inside a dict as {"command": startup_command} and passed to env.execute().

Test

Unit test test_get_sb_environment_runs_startup_command_as_dict() was added to test this exact fix.

@klieret

klieret commented Jun 29, 2026

Copy link
Copy Markdown
Member

oh! very good catch! Tysm!

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/minisweagent/run/benchmarks/swebench.py 86.66% <100.00%> (+2.00%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@klieret
klieret merged commit 59e7751 into SWE-agent:main Jun 29, 2026
6 checks passed
@klieret

klieret commented Jun 29, 2026

Copy link
Copy Markdown
Member

Congrats to your first contrib, now part of 2.4.3 ❤️

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.

2 participants