Skip to content

[bug] Responses conversation continuation drops materialized cross-format history #802

Description

@Atharva-Kanherkar

Symptom

A Responses client continuing a cross-format Chat conversation by conversation loses all prior turns. Continuing by previous_response_id keeps them.

Reproduction

Pinned at bfcd023c (current main, 2026-09-20), passthrough route from OpenAI Responses to an OpenAI Chat backend (format = "openai_chat") with a deterministic capture upstream. Seed then recall:

{"model":"switchyard/chat","input":"SEED","conversation":"conv_1"}
{"model":"switchyard/chat","input":"RECALL","conversation":"conv_1"}

The recall reaches the Chat backend with only RECALL. Control: same route, same seed, replace conversation with the returned previous_response_id. The backend then receives the seed user turn, seed assistant answer, and recall.

Result: history lost 5/5 with conversation, preserved 5/5 with previous_response_id.

Expected vs. actual

  • Expected: both continuation mechanisms carry the same materialized history. PR fix(client): materialize cross-format Responses state #781 promises canonical history for cross-format stored Responses continuations.
  • Actual: the conversation follow-up forwards only the new turn. The server returns HTTP 200 with a plausible but context-free answer.

Root cause

crates/libsy-llm-client/src/run.rs at this commit. remember_canonical_response (line 839) calls:

.remember(response_id, None, model, Some(history))   // line 863

The conversation id is hardcoded to None. remember_response (line 828) passes the real conversation, and native Responses recording passes both ids (line 718). The later conversation lookup misses, so routing silently continues without history.

Environment

  • Switchyard version (or commit SHA): bfcd023cb6791efd8ac59d32afb5095c74fef1ff
  • Python version: N/A
  • OS / arch: macOS arm64
  • Install path: source build
  • Inbound format: Responses
  • Backend: OpenAI Chat Completions (local deterministic capture)

Additional context

cc @sabhatinas

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions