Skip to content

Conversation

@xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Jan 26, 2026

Summary

This PR fixes the failing PyPI release workflow that creates version bump PRs.

Problem

The workflow was failing with the error:

Cannot enrich dependency with incompatible constraints: openhands-agent-server (==1.10.0) and openhands-agent-server (==1.9.1)

See failed run: https://github.com/OpenHands/software-agent-sdk/actions/runs/21366085620/job/61499460469

Root Cause

When creating the version bump PR for the OpenHands repo, the workflow:

  1. Updated pyproject.toml in the root with new SDK package versions
  2. Ran poetry lock in the root directory
  3. Then updated enterprise/pyproject.toml

However, step 2 failed because the enterprise/ directory has its own pyproject.toml that depends on the OpenHands SDK packages, and Poetry resolves dependencies across the entire project. Since enterprise/pyproject.toml still had the old version (1.9.1) while the root had the new version (1.10.0), Poetry couldn't resolve the conflicting constraints.

Solution

Update both pyproject.toml files (root and enterprise) before running poetry lock. This ensures there are no conflicting dependency constraints when Poetry resolves dependencies.

The workflow now:

  1. Updates pyproject.toml in the root with new SDK package versions
  2. Updates enterprise/pyproject.toml with new SDK package versions
  3. Runs poetry lock in the root directory (now succeeds)
  4. Runs poetry lock in the enterprise directory
  5. Updates the AGENT_SERVER_IMAGE hash

Changes

  • Modified .github/workflows/pypi-release.yml to update enterprise/pyproject.toml before running poetry lock
  • Updated commit message and PR body to reflect the additional enterprise changes

@xingyaoww can click here to continue refining the PR


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:341244b-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-341244b-python \
  ghcr.io/openhands/agent-server:341244b-python

All tags pushed for this build

ghcr.io/openhands/agent-server:341244b-golang-amd64
ghcr.io/openhands/agent-server:341244b-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:341244b-golang-arm64
ghcr.io/openhands/agent-server:341244b-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:341244b-java-amd64
ghcr.io/openhands/agent-server:341244b-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:341244b-java-arm64
ghcr.io/openhands/agent-server:341244b-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:341244b-python-amd64
ghcr.io/openhands/agent-server:341244b-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-amd64
ghcr.io/openhands/agent-server:341244b-python-arm64
ghcr.io/openhands/agent-server:341244b-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-arm64
ghcr.io/openhands/agent-server:341244b-golang
ghcr.io/openhands/agent-server:341244b-java
ghcr.io/openhands/agent-server:341244b-python

About Multi-Architecture Support

  • Each variant tag (e.g., 341244b-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 341244b-python-amd64) are also available if needed

…ump workflow

The workflow was failing with 'Cannot enrich dependency with incompatible constraints'
because enterprise/pyproject.toml still depended on the old version of openhands-agent-server
when poetry lock was run in the root directory.

This fix updates enterprise/pyproject.toml with the new SDK package versions BEFORE
running poetry lock to avoid conflicting dependency constraints.

Fixes: https://github.com/OpenHands/software-agent-sdk/actions/runs/21366085620/job/61499460469

Co-authored-by: openhands <openhands@all-hands.dev>
@xingyaoww xingyaoww marked this pull request as ready for review February 1, 2026 03:10
@xingyaoww xingyaoww requested review from enyst, malhotra5 and neubig and removed request for neubig February 1, 2026 03:10
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.

Code Review

The fix correctly addresses the root cause by updating both pyproject.toml files before running poetry lock. However, there are robustness and maintainability issues that should be addressed.

echo "📝 Updating enterprise/pyproject.toml..."
cd enterprise
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
cd ..
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟠 Important: The cd enterprise / cd .. pattern is fragile and error-prone.

Problems:

  • If any command between the cd operations fails, the script continues in the wrong directory
  • No verification that we return to the correct location
  • Makes debugging harder

Better approach:

(cd enterprise && poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION") || exit 1

The subshell (...) ensures we always return to the original directory, and || exit 1 provides error handling.

echo "🔒 Running poetry lock in enterprise/..."
cd enterprise
poetry lock
cd ..
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟠 Important: Same fragile cd pattern here. Use a subshell for safety:

Suggested change
cd ..
(cd enterprise && poetry lock) || exit 1

echo "📝 Updating pyproject.toml..."
# 1. Update versions in pyproject.toml using poetry (root)
echo "📝 Updating root pyproject.toml..."
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟠 Important: No error checking. If poetry add fails, the workflow continues and will fail later with a confusing error.

Add error checking:

poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION" || exit 1


# 3. Generate poetry.lock in root
echo "🔒 Running poetry lock in root..."
poetry lock
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟠 Important: Add error checking here too:

Suggested change
poetry lock
poetry lock || exit 1

If poetry lock fails, we should stop immediately rather than continue with an inconsistent state.

Comment on lines +165 to 167
# 1. Update versions in pyproject.toml using poetry (root)
echo "📝 Updating root pyproject.toml..."
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: The numbered comments (# 1., # 2., etc.) are maintenance burden. Every time a step is added or removed, all subsequent numbers need updating.

The echo statements already provide clear context. Consider removing the numbers:

# Update versions in pyproject.toml using poetry (root)
echo "📝 Updating root pyproject.toml..."


# 2. Generate poetry.lock in root
# 2. Update versions in enterprise/pyproject.toml using poetry
# Must be done BEFORE running poetry lock in root to avoid conflicting constraints
Copy link
Collaborator

Choose a reason for hiding this comment

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

🟡 Suggestion: This comment is verbose. The commit message and the fix itself make this clear.

Consider a more concise version:

# Update enterprise pyproject.toml (must be done before root poetry lock)

@xingyaoww xingyaoww enabled auto-merge (squash) February 2, 2026 05:50
@xingyaoww xingyaoww disabled auto-merge February 2, 2026 15:12
@xingyaoww xingyaoww enabled auto-merge (squash) February 2, 2026 15:12
Copy link
Collaborator

@enyst enyst left a comment

Choose a reason for hiding this comment

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

LGTM

@xingyaoww xingyaoww merged commit 4d217c1 into main Feb 2, 2026
18 checks passed
@xingyaoww xingyaoww deleted the fix-pypi-release-poetry-lock-conflict branch February 2, 2026 15:15
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.

4 participants