Skip to content

Conversation

@rbren
Copy link
Contributor

@rbren rbren commented Oct 30, 2025

Summary

This PR fixes several incorrect API endpoints in the RemoteConversation class 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

  1. sendMessage:

    • Before: /api/conversations/{id}/send_message
    • After: /api/conversations/{id}/events
  2. setConfirmationPolicy:

    • Before: /api/conversations/{id}/set_confirmation_policy
    • After: /api/conversations/{id}/confirmation_policy
  3. sendConfirmationResponse:

    • Before: /api/conversations/{id}/send_confirmation_response
    • After: /api/conversations/{id}/events/respond_to_confirmation
  4. updateSecrets:

    • Before: /api/conversations/{id}/update_secrets
    • After: /api/conversations/{id}/secrets
  5. conversationStats:

    • Before: /api/conversations/{id}/stats (endpoint doesn't exist)
    • After: Gets stats from /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

  • ✅ TypeScript compilation passes (npm run build)
  • ✅ All existing tests pass (npm test)
  • ✅ ESLint passes with only existing warnings (no new errors)

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

  • OpenAPI specification: swagger-doc.json
  • Related to the agent server implementation in the software-agent-sdk repository

@rbren can click here to continue refining the PR

- 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 <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Oct 30, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • CI

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #9 at branch `fix-api-endpoints`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

Co-authored-by: openhands <openhands@all-hands.dev>
@rbren rbren marked this pull request as ready for review October 30, 2025 03:19
@rbren rbren merged commit 6cea28d into main Oct 30, 2025
6 checks passed
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.

3 participants