@@ -3,10 +3,10 @@ name: Create Version Bump PRs
33
44on :
55 # Triggered by pypi-release workflow after successful publish
6+ # Note: No branches filter - releases run on tags (e.g., v1.11.4), not branches
67 workflow_run :
78 workflows : [Publish all OpenHands packages (uv)]
89 types : [completed]
9- branches : [main, rel-*]
1010 # Allow manual trigger with version input
1111 workflow_dispatch :
1212 inputs :
@@ -217,16 +217,30 @@ jobs:
217217
218218 # 1. Update versions in pyproject.toml and poetry.lock using poetry (root)
219219 # The --lock flag updates both pyproject.toml AND poetry.lock
220+ # Note: enterprise/pyproject.toml gets these dependencies transitively via openhands-ai
220221 echo "📝 Updating root pyproject.toml and poetry.lock..."
221- poetry add --lock "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
222222
223- # 2. Update versions in enterprise/pyproject.toml and poetry.lock using poetry
224- echo "📝 Updating enterprise/pyproject.toml and poetry.lock..."
225- cd enterprise
223+ # Verify enterprise/pyproject.toml does NOT have SDK packages explicitly listed
224+ # If they exist there, they will become stale since we only update root pyproject.toml
225+ if [ -f "enterprise/pyproject.toml" ]; then
226+ echo "🔍 Verifying enterprise/pyproject.toml doesn't have explicit SDK packages..."
227+ SDK_PACKAGES=("openhands-sdk" "openhands-tools" "openhands-agent-server")
228+ for pkg in "${SDK_PACKAGES[@]}"; do
229+ # Match package name as a TOML key (with optional leading whitespace) followed by =
230+ # This catches both 'openhands-sdk = "1.2.3"' and 'openhands-sdk="1.2.3"'
231+ if grep -qE "^[[:space:]]*${pkg}[[:space:]]*=" enterprise/pyproject.toml; then
232+ echo "❌ ERROR: enterprise/pyproject.toml contains explicit reference to '$pkg'"
233+ echo " These packages should come transitively via openhands-ai dependency."
234+ echo " Please remove '$pkg' from enterprise/pyproject.toml to avoid version drift."
235+ exit 1
236+ fi
237+ done
238+ echo "✅ enterprise/pyproject.toml does not have explicit SDK packages"
239+ fi
240+
226241 poetry add --lock "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
227- cd ..
228242
229- # 3 . Update the hash in sandbox_spec_service.py
243+ # 2 . Update the hash in sandbox_spec_service.py
230244 echo "🔧 Updating AGENT_SERVER_IMAGE hash..."
231245 SANDBOX_SPEC_FILE="openhands/app_server/sandbox/sandbox_spec_service.py"
232246 if [ -f "$SANDBOX_SPEC_FILE" ]; then
@@ -238,10 +252,10 @@ jobs:
238252 exit 1
239253 fi
240254
241- # 4 . Run pre-commit to fix formatting (pyproject-fmt removes parentheses from version specs)
255+ # 3 . Run pre-commit to fix formatting (pyproject-fmt removes parentheses from version specs)
242256 echo "🔧 Running pre-commit to fix formatting..."
243257 pip install pre-commit
244- pre-commit run --files pyproject.toml enterprise/pyproject.toml --config ./dev_config/python/.pre-commit-config.yaml || true
258+ pre-commit run --files pyproject.toml --config ./dev_config/python/.pre-commit-config.yaml || true
245259
246260 # Check if there are changes
247261 if git diff --quiet; then
@@ -256,9 +270,7 @@ jobs:
256270 -m "" \
257271 -m "Changes:" \
258272 -m "- Updated SDK packages to v$VERSION in pyproject.toml" \
259- -m "- Updated SDK packages to v$VERSION in enterprise/pyproject.toml" \
260273 -m "- Regenerated poetry.lock" \
261- -m "- Regenerated enterprise/poetry.lock" \
262274 -m "- Updated AGENT_SERVER_IMAGE hash to ${SDK_COMMIT_HASH}" \
263275 -m "" \
264276 -m "Co-authored-by: openhands <openhands@all-hands.dev>"
@@ -282,9 +294,7 @@ jobs:
282294
283295 ### Changes
284296 - Updated SDK packages in \`pyproject.toml\`
285- - Updated SDK packages in \`enterprise/pyproject.toml\`
286297 - Regenerated \`poetry.lock\`
287- - Regenerated \`enterprise/poetry.lock\`
288298 - Updated \`AGENT_SERVER_IMAGE\` hash to \`${SDK_COMMIT_HASH}\` in \`sandbox_spec_service.py\`
289299
290300 **Triggered by:** Release of [software-agent-sdk v$VERSION](https://github.com/OpenHands/software-agent-sdk/releases/tag/v$VERSION)
0 commit comments