Use version tag for agent server image in version bump prs#2427
Conversation
Python API breakage checks — ✅ PASSEDResult: ✅ PASSED |
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Issue:
|
|
@OpenHands check why this workflow failed https://github.com/OpenHands/software-agent-sdk/actions/runs/23071803626/job/67023767599. Is the poetry version 2.2.1? |
|
I'm on it! aivong-openhands can track my progress at all-hands.dev |
The --no-update flag was removed in Poetry 2.x. The default behavior in Poetry 2.x is to not update packages already in the lock file, making the flag unnecessary. Co-authored-by: openhands <openhands@all-hands.dev>
Investigation ResultsYes, the workflow is using Poetry version 2.2.1 (as shown in the logs: Root CauseThe workflow failed because it was using From the error message: The FixIn Poetry 2.x, the default behavior of Commit: ef98e81 |
Final SummaryAnswer to the QuestionYes, Poetry version 2.2.1 was being used in the failed workflow (confirmed from logs: Root CauseThe workflow failed because it used Fix AppliedIn Poetry 2.x, the default behavior of Changes Made (already pushed)Commit: ef98e81 - poetry lock --no-update
+ # Note: In Poetry 2.x, the default behavior is to not update packages already
+ # in the lock file (the --no-update flag was removed in Poetry 2.x)
+ poetry lockAlso fixed step comment numbering (duplicate "# 2." → "# 3." and "# 4."). Checklist
|
all-hands-bot
left a comment
There was a problem hiding this comment.
🟡 Acceptable - Pragmatic simplification that solves a real problem. The sed approach is a reasonable workaround for Poetry's version normalization behavior, though it comes with inherent fragility. One important concern about missing validation.
|
|
||
| # Update [project].dependencies section (PEP 621 format) | ||
| # Matches: "openhands-sdk==1.13.1", or "openhands-sdk==1.13", | ||
| sed -i -E 's/"openhands-sdk==[^"]*"/"openhands-sdk=='"$VERSION"'"/' pyproject.toml |
There was a problem hiding this comment.
🟠 Important: Missing validation that the version tag exists in the registry.
The old code validated the tag existed before proceeding:
SDK_COMMIT_HASH=$(git ls-remote ... "refs/tags/v$VERSION" | cut -c1-7)
if [ -z "$SDK_COMMIT_HASH" ]; then
echo "⚠️ Could not find commit hash..."
fiConsider adding validation that the agent-server image with this version tag is actually published before updating references. This would catch synchronization issues between SDK releases and agent-server image publishing.
Example:
# Validate version exists in GHCR
if ! docker manifest inspect "ghcr.io/openhands/agent-server:${VERSION}-python" > /dev/null 2>&1; then
echo "❌ Image tag ${VERSION} not found in registry"
exit 1
fiHowever, if the release process guarantees the images are published before this workflow triggers, this validation may be unnecessary overhead.
| # inconsistencies between [tool.poetry.dependencies] and [project].dependencies | ||
| echo "📝 Updating pyproject.toml with exact version pins..." | ||
|
|
||
| # Update [tool.poetry.dependencies] section |
There was a problem hiding this comment.
🟡 Suggestion: The sed approach is fragile but pragmatic.
Six separate sed commands with regex patterns will break if pyproject.toml formatting changes. The comment explaining Poetry's normalization behavior is helpful.
This is an acceptable trade-off - you're working around a tool limitation. The explicit approach (vs. a loop) makes debugging easier when things break.
Consider adding a validation step after the sed commands to ensure all three packages were actually updated:
# Verify all packages were updated
for pkg in openhands-sdk openhands-tools openhands-agent-server; do
if ! grep -q "\"$pkg.*$VERSION\"" pyproject.toml; then
echo "❌ Failed to update $pkg to $VERSION"
exit 1
fi
done| - name: Install Poetry | ||
| run: | | ||
| pipx install poetry | ||
| pipx install poetry==2.2.1 |
There was a problem hiding this comment.
🟢 Acceptable: Pinning Poetry to 2.2.1 is pragmatic for reproducibility.
Just remember to bump this when Poetry releases contain fixes you need. The lock file regeneration behavior mentioned in line 255 is specific to Poetry 2.x, so this pin ensures the workflow doesn't break with unexpected version changes.
Summary
sedTest run of workflow generated the following version bump PR: OpenHands/OpenHands#13394
Checklist
Agent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.13-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:59874b3-pythonRun
All tags pushed for this build
About Multi-Architecture Support
59874b3-python) is a multi-arch manifest supporting both amd64 and arm6459874b3-python-amd64) are also available if needed