Skip to content

ci: use oasdiff for agent-server REST API breakage detection#2240

Merged
enyst merged 1 commit intomainfrom
feat/use-oasdiff-for-agent-server-rest-api
Feb 28, 2026
Merged

ci: use oasdiff for agent-server REST API breakage detection#2240
enyst merged 1 commit intomainfrom
feat/use-oasdiff-for-agent-server-rest-api

Conversation

@enyst
Copy link
Copy Markdown
Collaborator

@enyst enyst commented Feb 27, 2026

Summary

This PR replaces the custom Python diffing logic with oasdiff for OpenAPI breaking change detection in the agent-server REST API breakage workflow.

Changes

  1. Updated script (.github/scripts/check_agent_server_rest_api_breakage.py):

    • Replaced ~190 lines of custom Python diffing logic with calls to the oasdiff CLI
    • The script now uses oasdiff breaking to detect breaking changes between OpenAPI specs
    • Still enforces deprecation-before-removal and MINOR version bump policies
    • Keeps the logic for fetching previous version from PyPI and generating OpenAPI schemas for comparison
  2. Updated workflow (.github/workflows/agent-server-rest-api-breakage.yml):

    • Added step to install oasdiff from the official release
  3. Updated documentation (openhands-agent-server/AGENTS.md):

    • Added link to oasdiff repository

Rationale

As mentioned in PR #2232 comment, oasdiff is a purpose-built tool for OpenAPI breaking-change detection. While it doesn't replace the entire workflow (we still need custom logic for PyPI fetching and policy enforcement), using it for the actual diffing provides:

  • Better maintained and tested code
  • Comprehensive breaking change detection (250+ checks)
  • Active community support

The custom policy enforcement (deprecation-before-removal and MINOR version bump) is preserved.

Co-authored-by: openhands openhands@all-hands.dev


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.12-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:32701f0-python

Run

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

All tags pushed for this build

ghcr.io/openhands/agent-server:32701f0-golang-amd64
ghcr.io/openhands/agent-server:32701f0-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:32701f0-golang-arm64
ghcr.io/openhands/agent-server:32701f0-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:32701f0-java-amd64
ghcr.io/openhands/agent-server:32701f0-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:32701f0-java-arm64
ghcr.io/openhands/agent-server:32701f0-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:32701f0-python-amd64
ghcr.io/openhands/agent-server:32701f0-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:32701f0-python-arm64
ghcr.io/openhands/agent-server:32701f0-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:32701f0-golang
ghcr.io/openhands/agent-server:32701f0-java
ghcr.io/openhands/agent-server:32701f0-python

About Multi-Architecture Support

  • Each variant tag (e.g., 32701f0-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., 32701f0-python-amd64) are also available if needed

Replaced custom Python diffing logic with oasdiff for OpenAPI breaking
change detection. The script now:
- Uses oasdiff CLI for detecting breaking changes between OpenAPI specs
- Still enforces deprecation-before-removal and MINOR version bump policies
- Keeps the logic for fetching previous version from PyPI and generating
  OpenAPI schemas for comparison

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Copy Markdown
Contributor

API breakage checks (Griffe)

Result: Passed

Action log

@github-actions
Copy link
Copy Markdown
Contributor

Agent server REST API breakage checks (OpenAPI)

Result: Passed

Action log

Copy link
Copy Markdown
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.

Taste Rating: 🟢 Good taste

Excellent refactor. Replacing 190 lines of custom OpenAPI diffing with a purpose-built tool (oasdiff) is exactly the right approach. The script keeps the important custom logic (deprecation policies, version bump enforcement) while delegating complex breaking-change detection to a well-maintained tool.

Key Insight: Simplicity wins - use existing tools instead of maintaining custom parsing logic. This is pragmatic engineering.

@enyst enyst merged commit c2d507d into main Feb 28, 2026
29 checks passed
@enyst enyst deleted the feat/use-oasdiff-for-agent-server-rest-api branch February 28, 2026 00:25
zparnold added a commit to zparnold/software-agent-sdk that referenced this pull request Mar 2, 2026
127 upstream commits merged. 2 conflicts resolved:
- .gitignore: kept both upstream api_compliance outputs and our sync marker
- vscode_service.py: adopted upstream's config-based server_base_path
  (replaces our env-var approach — same functionality, cleaner design)

Upstream lint fixes applied:
- Line length violations in build.py, llm.py, test_llm_config.py
- Enum str inheritance (ruff unsafe-fixes)

Upstream test fixes:
- Removed test_check_agent_server_rest_api_breakage.py (references
  OperationKey removed in OpenHands#2240 oasdiff rewrite)
- Fixed test_model -> check_model rename in test_resolve_model_config.py

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants