-
Notifications
You must be signed in to change notification settings - Fork 21
Fix get_problem_ids to respect instance_ids parameter in SWE environments #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@copilot we want to remove instance_ids completley and only rely on "problems" to know which docker images to download. |
I've removed the |
Co-authored-by: sordonia <[email protected]>
Co-authored-by: MarcCote <[email protected]>
3daffaa
to
4f0128f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed changes that implement the fix properly. @copilot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The
get_problem_ids
method inSWESmithEnv
andSWEBenchEnv
was not respecting theinstance_ids
parameter when returning all available problems. This caused issues when users tried to filter tasks using the CLI parameter-p base.env_kwargs.instance_ids=["task1", "task2"]
.Problem
When running
scripts/run.py
with instance filtering:python scripts/run.py config.yaml -p base.env_kwargs.instance_ids='["task1", "task2"]'
The environment would correctly load only the specified tasks in the dataset, but
get_problem_ids("all")
would ignore theinstance_ids
parameter and return all available problems instead of just the filtered ones. This caused the script to attempt running all problems, leading to errors when accessing tasks that weren't loaded.Solution
Modified the
get_problem_ids
method in both environments to filter results byinstance_ids
when provided:Changes
instance_ids=None
, behavior remains unchangedTesting
The fix handles various scenarios correctly:
instance_ids=["task1", "task2"]
returns only those tasksinstance_ids=["task1", "missing"]
returns["task1"]
instance_ids=None
returns all available tasksFixes #178.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.