0xPlaygrounds / 0xPlaygrounds/rig

feat(openai): preserve Responses items for stateless replay

Aperta
#2,269 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
8.6k
Fork
959
Merge medio
4h 32m
PR unite (30g)
117

Descrizione

- [x] 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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Examine the OpenAI provider implementation in the codebase, focusing on the InputItem and Output::Message structs. Look for the raw streaming final handling and the methods that construct OpenAI requests. The goal is to modify these to accept and preserve compaction items and the phase field, ensuring the terminal response.output is fully exposed. Testing will involve verifying that a caller-built Responses request can be sent through Rig's existing authentication and SSE pipeline.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.