Issue evidence · AI API · BerriAI/litellm

Bridged /v1/responses stores the encoded resp_ id in SpendLogs.request_id, so previous_response_id session lookup never matches

GitHub issue: https://github.com/BerriAI/litellm/issues/46398

Not reproduced

With use_chat_completions_api: true, a follow-up using previous_response_id never reconstructs the conversation because SpendLogs holds the resp_ id.

What Badgr ran

Ran a LiteLLM 1.104.2 proxy with Postgres and a local mock chat endpoint that only answers "yellow" when the history contains it, using the issue's config and two /v1/responses calls 12 seconds apart.

What came back

  • The follow-up answered "Your favorite color is yellow.", so the session was reconstructed.
  • The SpendLogs row for the first call held the chatcmpl- id, which is what the lookup queries.

The reporter was on v1.102.1 and a real Qwen deployment; this run used 1.104.2 and a mock upstream, so it shows that version does not reproduce, not that 1.102.1 is fine.

Checked 2026-10-14 in Badgr’s local development environment.

← All issue evidence