Skip to content

fix: cache SDK sdist across image builds#515

Merged
simonrosenberg merged 2 commits intomainfrom
fix/cache-sdk-sdist-split
Mar 13, 2026
Merged

fix: cache SDK sdist across image builds#515
simonrosenberg merged 2 commits intomainfrom
fix/cache-sdk-sdist-split

Conversation

@simonrosenberg
Copy link
Collaborator

Summary

  • pre-build the vendored SDK sdist once per image-build run and pass it through to the SDK build helper
  • keep the SDK-owned build path and telemetry intact by using the newer prebuilt_sdist API in the vendored SDK
  • cover cached-sdist propagation in build_image() and build_all_images() tests

Testing

  • uv run pre-commit run --files benchmarks/utils/build_utils.py tests/test_image_utils.py
  • uv run pytest tests/test_image_utils.py

Split out of #507.

Pre-build the vendored SDK sdist once per image-build run and pass the path through to the SDK build helper so individual image builds can reuse it. This keeps the existing SDK-owned build path and telemetry while removing repeated sdist work across batches.

Bump the vendored software-agent-sdk submodule to the compatible prebuilt-sdist API commit and update uv.lock to match the new workspace dependency graph.

Co-authored-by: openhands <openhands@all-hands.dev>
Copy link
Collaborator

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Good taste - Clean caching optimization that solves a real problem without adding complexity.

Key strengths:

  • Pragmatic solution: Builds SDK sdist once and reuses it across all image builds
  • Proper resource management: Context manager ensures temp directory cleanup
  • Graceful degradation: Falls back to per-image builds if caching fails
  • Well-tested: Verifies parameter propagation through both single and multi-image build paths
  • Backward compatible: Optional parameter, no breaking changes

Verdict: ✅ Worth merging - Straightforward efficiency improvement with solid error handling and appropriate test coverage.

Update the vendored software-agent-sdk submodule from the merge resolution commit to the exact head of software-agent-sdk PR #2426 so benchmarks PR #515 tracks the intended SDK change directly.

Co-authored-by: openhands <openhands@all-hands.dev>
@simonrosenberg
Copy link
Collaborator Author

Updated vendor/software-agent-sdk in this branch to the exact head of software-agent-sdk#2426 (9b4fd045), instead of the later merge-resolution commit I had pinned initially.

Validation after the submodule update:

  • uv lock
  • uv run pytest tests/test_image_utils.py

@simonrosenberg simonrosenberg merged commit ec499e9 into main Mar 13, 2026
2 checks passed
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.

2 participants