Rename image_exists to remote_image_exists#471
Merged
simonrosenberg merged 1 commit intomainfrom Mar 2, 2026
Merged
Conversation
The function only checks remote registries, while local_image_exists was already named correctly. This rename makes the distinction explicit. Updated the definition in image_utils.py and all 10 import/call sites. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
all-hands-bot
approved these changes
Mar 2, 2026
Collaborator
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste
This is exactly what a refactoring should be: simple, complete, and solves a real problem.
KEY INSIGHT: The rename from image_exists to remote_image_exists eliminates naming ambiguity when paired with local_image_exists. The relationship is now immediately clear without needing to read the implementation.
Why this works:
- Solves actual maintainability issue (naming confusion)
- Complete and systematic (all 10 call sites updated)
- No complexity added (pure rename + docstring)
- Already validated by CI
Particularly nice: build_eval_env_images.py previously needed import image_exists as remote_image_exists as a workaround. Now it just imports the correctly-named function directly.
✅ Worth merging: Clean refactoring with no issues.
simonrosenberg
added a commit
that referenced
this pull request
Mar 3, 2026
Resolve conflicts after sub-PRs #471, #472, #473 were merged to main: - Take main's SDK_SHORT_SHA deprecation handling in version.py - Take main's backward-compat SDK_SHORT_SHA in modal_patches.py - Take main's log message wording in swebench/run_infer.py - Remove redundant prompt_dir setup (superseded by add_prompt_path_argument) - Keep lazy imports for git-dependent modules (build_utils.py, swtbench/run_infer.py) - Take main's comment cleanup in swtbench/eval_infer.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
juanmichelini
pushed a commit
that referenced
this pull request
Mar 3, 2026
Root Cause: PR #471 (commit 2a7ff00) renamed image_exists() to remote_image_exists() and removed the local Docker check on March 2, 2026. This caused every build_image() call to make HTTP requests to GHCR, creating 500+ concurrent requests when building large batches (e.g., all SWE-Bench images). Impact: - Small builds (1-50 images): Manageable HTTP load, still works - Large builds (500 images): Overwhelming HTTP load, causes 5+ hour hangs - Last successful 500-image build: January 8, 2026 - First stuck builds: March 3, 2026 (immediately after the PR merged) Fix: Restore local_image_exists() check BEFORE remote_image_exists() check in build_image(). This ensures: 1. Fast local Docker checks happen first (<100ms per image) 2. Remote registry checks only for truly missing images 3. Batch builds complete in reasonable time (5-40 minutes) Testing: - All 14 tests in tests/test_image_utils.py pass - Pre-commit checks pass (ruff, pycodestyle, pyright) Fixes #476 Co-authored-by: openhands <openhands@all-hands.dev>
5 tasks
juanmichelini
pushed a commit
that referenced
this pull request
Mar 4, 2026
Root Cause: PR #471 (commit 92efb47) renamed image_exists() to remote_image_exists() and removed the local Docker check on March 2, 2026. This caused every build_image() call to make HTTP requests to GHCR, creating 500+ concurrent requests when building large batches (e.g., all SWE-Bench images). Impact: - Small builds (1-50 images): Manageable HTTP load, still works - Large builds (500 images): Overwhelming HTTP load, causes 5+ hour hangs - Last successful 500-image build: January 8, 2026 - First stuck builds: March 3, 2026 (immediately after the PR merged) Fix: Restore local_image_exists() check BEFORE remote_image_exists() check in build_image(). This ensures: 1. Fast local Docker checks happen first (<100ms per image) 2. Remote registry checks only for truly missing images 3. Batch builds complete in reasonable time (5-40 minutes) Testing: - All 14 tests in tests/test_image_utils.py pass - Pre-commit checks pass (ruff, pycodestyle, pyright) Fixes #476 Co-authored-by: openhands <openhands@all-hands.dev>
simonrosenberg
pushed a commit
that referenced
this pull request
Mar 4, 2026
After investigation based on reviewer feedback: - PR #471 only renamed functions, did not remove any local Docker check - The image_exists function was always remote-only (HTTP requests) - March 3rd stuck builds were transient - builds before/after succeeded - Builds are now working without this fix being merged This change is now correctly framed as a performance optimization: - Adds local Docker check before remote registry check - Skips HTTP requests when images exist locally - Useful for local development and re-runs Co-authored-by: openhands <openhands@all-hands.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
image_exists→remote_image_existsinbenchmarks/utils/image_utils.pyfor clarity: the function only checks remote registries, whilelocal_image_existswas already named correctlySplit out from #455.
CI validation
All benchmarks pass with this rename (validated in the parent PR):
Test plan
image_existsname (grep -r "image_exists" --include="*.py"returns onlylocal_image_existsandremote_image_exists)🤖 Generated with Claude Code