Skip to content

Generate typed REST API models from OpenAPI#165

Draft
neubig wants to merge 1 commit into
mainfrom
openhands/generated-rest-types
Draft

Generate typed REST API models from OpenAPI#165
neubig wants to merge 1 commit into
mainfrom
openhands/generated-rest-types

Conversation

@neubig
Copy link
Copy Markdown
Contributor

@neubig neubig commented May 15, 2026

  • A human has tested these changes.

Why

ConversationClient.createConversation() accepted a loose Record<string, unknown> payload, forcing frontend consumers to duplicate Agent Server request models by hand. Fixes #164.

Summary

  • Regenerate swagger-doc.json from the current Agent Server OpenAPI schema and add generated TypeScript API models.
  • Type ConversationClient.createConversation() with StartConversationRequest and the generated ConversationInfo response by default.
  • Export generated REST payload/settings types from the root, clients entrypoint, and new @openhands/typescript-client/agent-server-api subpath.
  • Add regression tests covering typed createConversation payloads with agent_settings and generated settings request/response exports.

Issue Number

Fixes #164

How to Test

  • npm ci
  • npm run build
  • npm test -- --runInBand
  • npm run lint
  • npm run format:check

Video/Screenshots

Not applicable; this is a TypeScript type/API surface change.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Lint completes with the repository's existing warnings only (no errors).

This PR was created by an AI agent (OpenHands) on behalf of the user.

@neubig can click here to continue refining the PR

Co-authored-by: openhands <openhands@all-hands.dev>
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.

Generate typed REST request payloads from agent-server OpenAPI schema

2 participants