Problem
ConversationClient.createConversation() currently accepts CreateConversationPayload = Record<string, unknown>. That makes frontend consumers hand-maintain partial copies of Python/Pydantic request shapes such as StartConversationRequest, or fall back to loose payload typing at exactly the boundary where correctness matters.
This came up while integrating Agent Canvas with openhands-agent-server 1.22.0. The agent server supports starting conversations with agent_settings so the SDK can call create_agent() server-side. Without generated TS types for that request shape, the frontend can only locally type the top-level fields and has to leave SDK-owned nested shapes loose.
Proposal
Generate and export TypeScript request/response types from the agent-server OpenAPI schema, including at least:
StartConversationRequest
- conversation create response /
ConversationInfo
- settings request/response shapes used by the frontend
- related discriminated SDK models referenced by these REST payloads where OpenAPI can express them
A likely implementation path is to generate types from /openapi.json using a tool such as openapi-typescript, then have the client methods reference those generated request body / response types instead of Record<string, unknown>.
Desired outcome
Consumers should be able to write code like:
import type { StartConversationRequest } from @openhands/typescript-client/...;
const payload: StartConversationRequest = {
agent_settings: { ... },
workspace: { kind: LocalWorkspace, working_dir: ... },
max_iterations: 500,
stuck_detection: true,
};
and pass that payload to ConversationClient.createConversation() without duplicating the Python SDK model tree in downstream frontends.
Problem
ConversationClient.createConversation()currently acceptsCreateConversationPayload = Record<string, unknown>. That makes frontend consumers hand-maintain partial copies of Python/Pydantic request shapes such asStartConversationRequest, or fall back to loose payload typing at exactly the boundary where correctness matters.This came up while integrating Agent Canvas with
openhands-agent-server1.22.0. The agent server supports starting conversations withagent_settingsso the SDK can callcreate_agent()server-side. Without generated TS types for that request shape, the frontend can only locally type the top-level fields and has to leave SDK-owned nested shapes loose.Proposal
Generate and export TypeScript request/response types from the agent-server OpenAPI schema, including at least:
StartConversationRequestConversationInfoA likely implementation path is to generate types from
/openapi.jsonusing a tool such asopenapi-typescript, then have the client methods reference those generated request body / response types instead ofRecord<string, unknown>.Desired outcome
Consumers should be able to write code like:
and pass that payload to
ConversationClient.createConversation()without duplicating the Python SDK model tree in downstream frontends.