Skip to content

[Bug]: Open Responses API: response id (resp_…) is decoupled from the stored conversationId (uuid) — breaks previous_response_id continuation and GET /responses/:id #16315

Description

@vaibhav-Singh9888

What happened?

The Open Responses API returns a response id of the form resp_… (generateResponseId(), responses.js:631) but persists the conversation under a different, unrelated key — conversationId = request.previous_response_id ?? uuidv4() (responses.js:648). Nothing maps resp_… → uuid, and the caller only ever receives resp_…. Two documented behaviors of this endpoint therefore break:

1. previous_response_id never continues a conversation. Turn 2 with previous_response_id: "resp_…" runs getMessages({ conversationId: "resp_…" }), which never matches turn 1 (stored under the uuid) → the agent gets no prior context. It then tries to persist under the non-UUID resp_…, hitting the UUID_REGEX guard in saveMessage → "Invalid conversation ID", swallowed by the save try/catch → turn 2 stores nothing either.

2. GET /api/agents/v1/responses/:id always 404s. getResponse (responses.js:1780) does getConvo(userId, :id) treating the path id as a conversationId. Passing back the resp_… id from a POST finds nothing → 404 "Response not found", even though the conversation was stored. (The handler itself comments "The responseId could be either the response ID or the conversation ID" — but the client is never handed the conversation id.)

Version Information

v0.8.8-rc4

Steps to Reproduce

  • Continuation: POST {input:"My name is Bob", store:true} → note id; POST {input:"What is my name?", previous_response_id:<id>, store:true} → agent doesn't know the name; logs Invalid conversation ID: resp_….
  • GET: POST {store:true} → take id → GET /api/agents/v1/responses/<id> → 404.

Fix
Make the returned id equal the stored conversationId (same uuid for both) so it round-trips, or persist a resp_… → conversationId mapping and resolve it on both continuation and GET.

What browsers are you seeing the problem on?

No response

Relevant log output

NA

Screenshots

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions