Typed client: Model provider methods + nested-model types (#15492) - #336
Typed client: Model provider methods + nested-model types (#15492)#336juanmichelini wants to merge 5 commits into
Conversation
Endpoint auditContract: pinned release artifact
Actionable client-only calls (7)
Actionable server-only operations (7)
Documented non-divergences (13)Client calls intentionally absent from the filtered contract (11)
Reason: Operational Agent Server endpoints intentionally excluded from the filtered public release artifact.
Reason: Client-ahead API stacked on the pending Agent Server meta-profiles implementation.
Reason: Client-ahead API stacked on the pending Agent Server pre-flight LLM validation endpoint. Server operations covered by an exposed browser URL (2)
Reason: RemoteWorkspace.startWorkspaceSession exposes these authenticated URLs for browser iframe and file requests; they are not HttpClient method calls. |
Add typed client methods for the new /api/llm/connections endpoints from software-agent-sdk. Connect a vendor once with one key, pick from its model catalog; the key is stored as a named secret server-side and never returned (api_key_set only). - models/api: ProviderConnection, CreateConnectionRequest, UpdateConnectionRequest, ValidateConnectionResponse types. - LLMMetadataClient: listConnections / createConnection / getConnection / updateConnection (rotate key, rename, set models) / deleteConnection / validateConnection. Connection ids are URL-encoded in the path. - Re-export the new types from the package index. - Remove the stub src/llm/connections.ts (replaced by the real client methods). Tests: 8 new tests covering each endpoint (method, path, body unpacking, key rotation, id encoding). Full suite green: 311 passed. Lint clean (0 errors), build succeeds. Release gate: bump @openhands/typescript-client version and publish to npm before the OpenHands frontend consumes these endpoints. Refs OpenHands/OpenHands#15492, Linear OSS-5295. Co-authored-by: openhands <openhands@all-hands.dev>
…yped disconnect
- ValidateConnectionResponse gains a `verified` boolean so consumers can tell a
real network check from a catalog-only lookup
- validateConnection accepts { live } and forwards ?live=true
- deleteConnection now returns DisconnectConnectionResponse (affected profiles)
instead of void, matching the backend
- add createProfileFromConnection + request/response types for the
'pick a model the provider offers' Agent Profile flow
- export the new types from the package entrypoint
- tests: live-flag query, profile-creation body, and a typed HttpError
error-path assertion (status + parsed server body)
Co-authored-by: openhands <openhands@all-hands.dev>
Align the typed client with the reworked backend (software-agent-sdk#4455): providers hold one key (named secret) and a nested, user-managed model list. - api.ts: replace ProviderConnection/*Connection* types with ModelProvider, ProviderModel, Create/UpdateProviderRequest, ProviderModelPayload and TestProviderResponse (masked view: api_key_set only, no secret_name). - llm-client.ts: replace the connection + validate + profile-from-connection methods with provider CRUD, nested model CRUD (add/update/remove) and testProvider (optional key probe; never mutates the curated model list), all under /api/llm/model-providers. - index.ts: export the new provider types. - Replace connections-client.test.ts with providers-client.test.ts (12 tests). Refs OpenHands/OpenHands#15492. Co-authored-by: openhands <openhands@all-hands.dev>
Typed client: Model providers (provider-first)
Adds typed
@openhands/typescript-clientmethods and types for the Model providers endpoints, aligned to the reworked provider-centric backend (OpenHands/software-agent-sdk#4455). A provider holds one key (named secret) and a nested list of models. Tracks OpenHands/OpenHands#15492.What this adds
LLMMetadataClient, all under/api/llm/model-providers:listProviders/createProvider/getProvider/updateProvider/deleteProvideraddProviderModel/updateProviderModel/removeProviderModel(nested model CRUD)testProvider(optional key probe; returnssuggested_modelsand never mutates the curated model list)ModelProvider,ProviderModel { name, wire_api? },WireApi,CreateProviderRequest,UpdateProviderRequest,ProviderModelPayload,TestProviderResponse. The provider view is masked —api_key_setonly, no raw key and nosecret_name.Changed vs. the previous iteration
ProviderConnection+validateConnection+createProfileFromConnectionsurface with provider CRUD + nested model CRUD.testProviderreplacesvalidateConnection; it offers an optional catalog suggestion and never implies the model list was overwritten.connections-client.test.tswithproviders-client.test.ts.Testing
providers-client.test.ts(12 tests): each endpoint hits the right method/path/body, responses unpack correctly, id/model-name path encoding, and typedHttpErroron non-2xx.tsc --noEmitand eslint clean.Related PRs
This PR was created by an AI agent (OpenHands) on behalf of the user.