OpenHands / OpenHands/software-agent-sdk

Enforce behavioral parity between Python and TypeScript SDK clients

Open
#5,043 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

ci enhancement ready-for-dev sdk
Dominant language
Python
Stars
1.1k
Forks
539
Avg merge
1d 19h
Merged PRs (30d)
137

Description

Problem or Use Case

The Python SDK is documented as the reference implementation for the handwritten TypeScript SDK, while Agent Server OpenAPI is the source of truth for generated transport types. Current CI verifies the TypeScript client's pinned OpenAPI contract, generated types, package versions, and a few feature-specific registries, but it does not enforce behavioral parity between the public Python and TypeScript conversation/workspace clients.

This allowed conversation-scoped RemoteWorkspace routing to be added to TypeScript in #4966 while the equivalent Python client continued using only host-level routes. The omission was discovered later while preparing #5010. OpenAPI validation could not catch it because both the server route and TypeScript transport were valid.

Desired Behavior

CI should detect when a pull request adds or changes a public high-level conversation or workspace capability in the handwritten TypeScript client without the corresponding Python SDK capability. The check should distinguish this behavioral contract from generated OpenAPI transport coverage and should reuse the repository's existing client audit and CI machinery.

The Python SDK remains the behavioral reference. Intentional language-specific differences should require a narrow, reviewed exception with a rationale and tracking issue rather than passing silently.

Acceptance Criteria

  • A checked-in, machine-readable parity contract covers the public high-level conversation and workspace capabilities shared by the Python SDK and handwritten TypeScript client, including conversation-scoped runtime routing.
  • Existing TypeScript client CI validates that contract and fails with an actionable message when TypeScript introduces a covered capability without corresponding Python SDK support.
  • The check distinguishes generated Agent Server transport endpoints from high-level SDK behavior and does not require Python wrappers for generated-only or explicitly low-level TypeScript clients.
  • Intentional language-specific differences require an explicit exception containing a rationale, owner, and tracking issue.
  • A regression fixture demonstrates that the scoped-workspace mismatch exposed by #4966 would fail the check.
  • Repository documentation explains that Agent Server OpenAPI governs transport schemas while the Python SDK governs shared high-level client behavior.
  • Focused tests and existing TypeScript and Python CI checks pass.

Alternatives Considered

OpenAPI endpoint auditing alone cannot establish parity between high-level SDK abstractions because it describes server transport operations rather than which behaviors each language SDK exposes. Comparing method names directly would also be brittle because Python and TypeScript use different naming conventions and may organize equivalent behavior differently. A small explicit behavioral contract can extend the existing audit machinery while keeping exceptions visible and reviewable.

This issue was opened by an AI agent (OpenHands) on behalf of the user.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the repository's existing TypeScript client audit, CI checks, and Python and handwritten TypeScript conversation/workspace clients. Define the machine-readable parity contract and regression fixture around the conversation-scoped RemoteWorkspace mismatch from #4966, while separating generated OpenAPI transport coverage. Done means the check, reviewed exceptions, focused tests, and documentation all pass in existing CI.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, python, typescript
Domain
backend-api-design, ci-cd, developer-experience, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.