Skip to content

Conversation

@Gal-bloch
Copy link

Summary

This PR fixes an issue where OpenEvolve was not properly evaluating programs that depend on multiple files (e.g., Java projects with multiple .java files).

Problem

When using OpenEvolve with non-Python programs that have dependencies on other files in the same directory, the evaluator was only writing the modified program code to a temporary file without copying the supporting files. This caused evaluations to always use the initial program content instead of the evolved code.

Solution

Modified the Evaluator class to:

  • Accept an initial_program_path parameter
  • For non-Python programs, create a temporary directory that includes all files from the source directory
  • Replace the evolving file with the modified program code
  • This ensures all dependent files are available during evaluation

Changes

  • Added initial_program_path parameter to Evaluator.__init__()
  • Modified evaluate_program() to copy source directory for non-Python files
  • Updated Controller to pass the initial program path to the evaluator

Testing

The fix ensures that multi-file projects (like Java with TestFile.java + CodeFile.java) work correctly by providing all necessary files to the evaluation environment.

Fixes #402

- Add support for evaluating programs that depend on multiple files
- For non-Python programs, copy the source directory to temp and replace the evolving file
- This ensures fixed files are available during evaluation

Fixes algorithmicsuperintelligence#402
@CLAassistant
Copy link

CLAassistant commented Feb 9, 2026

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

Candidate evaluation issue

2 participants