-
Notifications
You must be signed in to change notification settings - Fork 81
Add Terminal Bench 2.0 (Harbor) support and refactor eval runner #504
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Zhiyao Jiang <jessicajiang324@gmail.com> Co-authored-by: Xinyu Jiang <xinyuj2@andrew.cmu.edu>
Co-authored-by: Zhiyao Jiang <jessicajiang324@gmail.com> Co-authored-by: Xinyu Jiang <xinyuj2@andrew.cmu.edu>
Co-authored-by: Zhiyao Jiang <jessicajiang324@gmail.com> Co-authored-by: Xinyu Jiang <xinyuj2@andrew.cmu.edu>
Summary of ChangesHello @XinyuJiangCMU, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the evaluation capabilities by integrating Terminal Bench 2.0 (Harbor) into the existing framework. It streamlines the evaluation process through a new, unified runner abstraction, allowing users to switch between different Terminal Bench versions simply by adjusting configuration. The changes also improve the maintainability and extensibility of the evaluation server by modularizing key functionalities. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request adds support for Terminal Bench 2.0 (Harbor) and refactors the evaluation pipeline. The changes introduce a unified runner abstraction, allowing selection between TB 1.0 and TB 2.0 via configuration. The eval server logic is also refactored for better separation of concerns.
My review focuses on the robustness and correctness of the new implementation. I've identified a few areas where the error handling and fallback logic could lead to incorrect or misleading results. Specifically, the handling of missing result files and the selection of evaluation data in the metrics parsing could be made more strict to prevent silent failures. I've also included a minor suggestion to improve a shell script and fix a typo in the documentation.
Overall, this is a solid contribution that significantly extends the evaluation capabilities. Addressing the points below will improve the reliability of the new evaluation pipeline.
| if not metrics_path.exists(): | ||
| fallback = TerminalBenchEvaluator._find_latest_result( | ||
| Path(payload.output_path or "jobs").expanduser() | ||
| ) | ||
| if fallback is not None: | ||
| metrics_path = fallback | ||
| if not metrics_path.exists(): | ||
| logger.warning("Results file missing at %s", metrics_path) | ||
| return {} |
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.
The fallback logic to find the latest result.json is risky. If a job fails to produce a results file, it could silently pick up the results from a previous or unrelated run, leading to incorrect metrics being reported. This can mask failures and produce misleading evaluation results. It would be safer to treat a missing results file as a hard error for the job.
if not metrics_path.exists():
logger.error("Results file missing at %s", metrics_path)
raise RuntimeError(f"Results file not found at {metrics_path}")| if entry is None: | ||
| entry = next(iter(evals.values())) | ||
| if not isinstance(entry, dict): |
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.
The logic to select the evaluation entry from the Harbor results file has a fallback that picks the first available entry if the expected one is not found (entry = next(iter(evals.values()))). This can lead to silently reporting metrics from the wrong evaluation if the file contains multiple entries and the expected one is missing. This should be a hard error to ensure metric correctness.
| if entry is None: | |
| entry = next(iter(evals.values())) | |
| if not isinstance(entry, dict): | |
| if entry is None: | |
| available_keys = ", ".join(evals.keys()) | |
| raise KeyError( | |
| f"Could not find any of the candidate eval keys {candidates} in result file. " | |
| f"Available keys: {available_keys}" | |
| ) | |
| if not isinstance(entry, dict): |
| sleep 3 | ||
| pkill -9 ray | ||
| pkill -9 python |
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.
| eval config (examples use `9051`): | ||
|
|
||
| ```bash | ||
| python miles/examples/eval/terminal_bench/tb_server.py --host 0.0.0.0 --port 9051 |
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.
There is a trailing space in the command example, which could be confusing or cause copy-paste errors for users. It's best to remove it.
| python miles/examples/eval/terminal_bench/tb_server.py --host 0.0.0.0 --port 9051 | |
| python miles/examples/eval/terminal_bench/tb_server.py --host 0.0.0.0 --port 9051 |
This is a follow-up PR to #447, which integrated Terminal Bench (TB) v1.0 into Miles.
📝 Summary
This PR adds support for Terminal Bench 2.0 via Harbor (
harbor run) and refactors the eval pipeline around a unified runner abstraction, allowing TB 1.0 and TB 2.0 to be selected via configuration only.runner: harborin the TB eval delegate, while keeping TB 1.0 (runner: tb) fully supported.runner_kwargsto pass CLI flags to bothtb runandharbor runwithout expanding client/server schemas.tb_server.pyintoutils/for better separation of concerns and extensibility.🤝 Collaborators