Fix incorrect API endpoints in RemoteConversation #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes several incorrect API endpoints in the
RemoteConversationclass that were causing 404 errors because the endpoints didn't exist on the agent server.Changes Made
After analyzing the OpenAPI specification (
swagger-doc.json) and comparing it with the current implementation, I identified and fixed the following incorrect endpoints:Fixed Endpoints
sendMessage:/api/conversations/{id}/send_message/api/conversations/{id}/eventssetConfirmationPolicy:/api/conversations/{id}/set_confirmation_policy/api/conversations/{id}/confirmation_policysendConfirmationResponse:/api/conversations/{id}/send_confirmation_response/api/conversations/{id}/events/respond_to_confirmationupdateSecrets:/api/conversations/{id}/update_secrets/api/conversations/{id}/secretsconversationStats:/api/conversations/{id}/stats(endpoint doesn't exist)/api/conversations/{id}response (stats are included in ConversationInfo)Endpoints That Were Already Correct
/api/conversations/{id}/run/api/conversations/{id}/pause/api/conversations/{id}/generate_title/api/conversations(for creating conversations)/api/conversations/{id}(for getting conversation info)Testing
npm run build)npm test)Impact
This fix ensures that the TypeScript client can successfully communicate with the OpenHands Agent Server without encountering 404 errors for these endpoints. All endpoints now match the official OpenAPI specification.
References
swagger-doc.jsonsoftware-agent-sdkrepository@rbren can click here to continue refining the PR