From 7c17a5682dfcd38ace3a9cce84be303711c379f9 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 30 Oct 2025 03:12:41 +0000 Subject: [PATCH 1/2] Fix incorrect API endpoints in RemoteConversation - Fix sendMessage endpoint from /send_message to /events - Fix setConfirmationPolicy endpoint from /set_confirmation_policy to /confirmation_policy - Fix sendConfirmationResponse endpoint from /send_confirmation_response to /events/respond_to_confirmation - Fix updateSecrets endpoint from /update_secrets to /secrets - Fix conversationStats to get stats from conversation info instead of non-existent /stats endpoint All endpoints now match the OpenAPI specification from the agent server implementation. Co-authored-by: openhands --- src/conversation/remote-conversation.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/conversation/remote-conversation.ts b/src/conversation/remote-conversation.ts index e568867..8d2175b 100644 --- a/src/conversation/remote-conversation.ts +++ b/src/conversation/remote-conversation.ts @@ -81,10 +81,10 @@ export class RemoteConversation { } async conversationStats(): Promise { - const response = await this.client.get( - `/api/conversations/${this.id}/stats` + const response = await this.client.get( + `/api/conversations/${this.id}` ); - return response.data; + return response.data.stats; } async sendMessage(message: string | Message): Promise { @@ -104,7 +104,7 @@ export class RemoteConversation { }; } - await this.client.post(`/api/conversations/${this.id}/send_message`, messageContent); + await this.client.post(`/api/conversations/${this.id}/events`, messageContent); } async run(): Promise { @@ -116,12 +116,12 @@ export class RemoteConversation { } async setConfirmationPolicy(policy: ConfirmationPolicyBase): Promise { - await this.client.post(`/api/conversations/${this.id}/set_confirmation_policy`, policy); + await this.client.post(`/api/conversations/${this.id}/confirmation_policy`, policy); } async sendConfirmationResponse(accept: boolean, reason?: string): Promise { const request: ConfirmationResponseRequest = { accept, reason }; - await this.client.post(`/api/conversations/${this.id}/send_confirmation_response`, request); + await this.client.post(`/api/conversations/${this.id}/events/respond_to_confirmation`, request); } async generateTitle(maxLength: number = 50, llm?: any): Promise { @@ -145,7 +145,7 @@ export class RemoteConversation { } const request: UpdateSecretsRequest = { secrets: secretStrings }; - await this.client.post(`/api/conversations/${this.id}/update_secrets`, request); + await this.client.post(`/api/conversations/${this.id}/secrets`, request); } async startWebSocketClient(): Promise { From e95e986846d0b0c9750458448bfa67c25e7c4f1a Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 30 Oct 2025 03:15:53 +0000 Subject: [PATCH 2/2] Fix code formatting with Prettier Co-authored-by: openhands --- src/conversation/remote-conversation.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/conversation/remote-conversation.ts b/src/conversation/remote-conversation.ts index 8d2175b..63df573 100644 --- a/src/conversation/remote-conversation.ts +++ b/src/conversation/remote-conversation.ts @@ -81,9 +81,7 @@ export class RemoteConversation { } async conversationStats(): Promise { - const response = await this.client.get( - `/api/conversations/${this.id}` - ); + const response = await this.client.get(`/api/conversations/${this.id}`); return response.data.stats; }