refactor(commit0): consolidate hyperparameters in constants.py#370
refactor(commit0): consolidate hyperparameters in constants.py#370simonrosenberg wants to merge 3 commits intomainfrom
Conversation
This commit creates a single source of truth for all Commit0 benchmark hyperparameters and constant values by introducing constants.py. Changes: - Create benchmarks/commit0/constants.py with all constant values: - Dataset configuration (DEFAULT_DATASET, DEFAULT_DATASET_SPLIT, DEFAULT_REPO_SPLIT) - Docker image configuration (DEFAULT_DOCKER_IMAGE_PREFIX, DEFAULT_IMAGE_TAG, CUSTOM_TAG_PREFIX) - Build configuration (BUILD_TARGET) - Workspace configuration (WORKSPACE_DIR) - Git configuration (GIT_BRANCH_NAME, AGENT_BRANCH_NAME) - Model configuration (DEFAULT_MODEL_NAME) - Runtime configuration (DEFAULT_RUNTIME_API_URL, timeouts) - Evaluation configuration (TOTAL_INSTANCES) - Update build_images.py to import constants from constants.py - Update run_infer.py to import constants from constants.py - Update eval_infer.py to import constants from constants.py - Add comprehensive tests for constants in test_constants.py Fixes #365 Co-authored-by: openhands <openhands@all-hands.dev>
Per user request: - Remove benchmarks/commit0/tests/test_constants.py - Remove WORKSPACE_DIR constant from constants.py - Revert all WORKSPACE_DIR usages back to hardcoded '/workspace' Co-authored-by: openhands <openhands@all-hands.dev>
|
Looks like there are a few issues preventing this PR from being merged!
If you'd like me to help, just leave a comment, like Feel free to include any additional details that might help me get this PR into a better state. You can manage your notification settings |
|
@OpenHands fix precommit issues |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
Co-authored-by: openhands <openhands@all-hands.dev>
|
I've fixed the pre-commit issues in PR #370. The problem was a ruff formatting issue in Change made:
Verification:
The PR should now pass the pre-commit checks in CI. |
|
@OpenHands |
|
I'm on it! simonrosenberg can track my progress at all-hands.dev |
Code Review Summary for PR #370🟢 Taste Rating: Good taste - Elegant, simple solution✅ Verification: No Constants or Behavior ChangedI verified all 15 extracted constants match their original hardcoded values exactly:
This is a pure refactoring with no behavioral changes. 🔧 Improvement Opportunities
🚀 Suggested Next Steps for Cleaner Code
Verdict: ✅ Worth MergingCore logic is sound, constants are correctly extracted with no behavioral changes. The suggested improvements can be addressed in follow-up PRs. |
Summary
This PR creates a single source of truth for all Commit0 benchmark hyperparameters and constant values by introducing
benchmarks/commit0/constants.py.Fixes #365
Changes
New File:
benchmarks/commit0/constants.pyCreated a centralized constants file containing all hyperparameters:
DEFAULT_DATASET,DEFAULT_DATASET_SPLIT,DEFAULT_REPO_SPLITDEFAULT_DOCKER_IMAGE_PREFIX,DEFAULT_IMAGE_TAG,CUSTOM_TAG_PREFIXBUILD_TARGETWORKSPACE_DIRGIT_BRANCH_NAME,AGENT_BRANCH_NAMEDEFAULT_MODEL_NAMEDEFAULT_RUNTIME_API_URL,DEFAULT_REMOTE_RUNTIME_STARTUP_TIMEOUT,DEFAULT_CONVERSATION_TIMEOUT,DEFAULT_COMMAND_TIMEOUTTOTAL_INSTANCESUpdated Files
build_images.py: Updated to import constants fromconstants.pyrun_infer.py: Updated to import constants fromconstants.pyeval_infer.py: Updated to import constants fromconstants.pyNew Tests:
tests/test_constants.pyAdded comprehensive tests for all constants including:
Benefits
Testing
All tests pass:
@simonrosenberg can click here to continue refining the PR