fix(cli): allow evaluation-only invocation without dummy seed path#27
fix(cli): allow evaluation-only invocation without dummy seed path#27shuofengzhang wants to merge 1 commit into
Conversation
Summary of ChangesHello, 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 addresses a critical usability issue in the command-line interface by overhauling how positional arguments are parsed. The change allows for more intuitive and reliable invocation of the tool, particularly for evaluation-only workflows, by moving from an ambiguous optional argument setup to explicit path handling. Additionally, it enhances the robustness of checkpoint discovery, contributing to overall system stability. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Code Review
This pull request effectively resolves the issue with the CLI's positional argument parsing, allowing for a more intuitive evaluation-only invocation. The approach of using a single paths argument with post-parsing normalization is a clean and robust solution. The accompanying refactor of _find_latest_checkpoint is also a great improvement, fixing a subtle bug and making the logic more resilient. Both changes are supported by clear and targeted tests. I have one minor suggestion to improve naming consistency for better maintainability.
| def parse_iteration(path: str) -> Optional[int]: | ||
| try: | ||
| return int(path.rsplit("_", 1)[-1]) |
There was a problem hiding this comment.
For clarity and consistency with the calling code on line 296 (iteration = parse_iteration(name)), the parameter path in the nested function parse_iteration should be renamed to name. This makes it clearer that the function operates on a directory name from os.listdir, not a full file system path.
| def parse_iteration(path: str) -> Optional[int]: | |
| try: | |
| return int(path.rsplit("_", 1)[-1]) | |
| def parse_iteration(name: str) -> Optional[int]: | |
| try: | |
| return int(name.rsplit("_", 1)[-1]) |
9f9967c to
cfb913c
Compare
|
@shuofengzhang Thanks for the catch! I'm thinking whether this can be done by simply changing the argument order from |
What changed
skydiscover-run <evaluation_file>(evaluation-only mode)skydiscover-run <initial_program> <evaluation_file>(seeded mode)initial_program?+ requiredevaluation_file) with a single positional list and explicit normalization logic.tests/test_cli_positional_paths.pyfor:Why
initial_programand still requiredevaluation_file.Insight / Why this matters
nargs='?'for initial program + required evaluation file), but argparse semantics make this pattern brittle.Testing
source .venv/bin/activate && pytest -q14 passed in 0.59s