#2269·rig

feat(openai): preserve Responses items for stateless replay

Author: codyw912Created Aug 8, 2026Updated Sep 7, 2026
  • I searched existing issues and pull requests

Motivation

Stateless Responses clients need to send prior output items back to OpenAI without losing fields.

OpenAI says the window returned by /responses/compact may contain regular items plus an opaque compaction item and should be passed to the next request as-is:

https://developers.openai.com/api/docs/guides/compaction#standalone-compact-endpoint

OpenAI also says to preserve ResponseOutputMessage.phase on follow-up requests because dropping it can degrade performance:

https://developers.openai.com/api/reference/resources/responses/methods/create

Current behavior

Verified on Rig main at 6f67b9db:

  • InputItem rejects "type": "compaction";
  • Output::Message drops the documented phase field;
  • the raw streaming final does not expose response.output; and
  • the raw OpenAI methods do not accept a caller-built Responses request.

Proposal

Could Rig provide a provider-native path for caller-built Responses requests and complete terminal response.output, preserving items such as compaction and documented fields such as phase?

The exact API is up to the maintainers. Rig would not need to perform compaction or manage conversation state.

PR #2234 covers server-managed compaction and response-ID chaining. This request is for clients that manage and resend state themselves.

Calling OpenAI directly works, but duplicates Rig's authentication, errors, telemetry, and SSE handling.