Responses API should support native `previous_response_id` chaining
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- api, backend-api-design, cli
Direzione di ricerca
Inizia tracciando il percorso della richiesta della Responses API e il campo del protocollo PreviousResponseId dell'SDK, quindi confronta le continuazioni degli strumenti, i turni utente successivi e le sessioni riprese. Il lavoro è completo quando i provider supportati usano ID di risposta conservati con input incrementale, preservano le impostazioni richieste, ricorrono alla cronologia completa quando il concatenamento fallisce e mantengono correttamente il contesto e il comportamento degli strumenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
When using the Copilot SDK/CLI with the Responses API, every model round reconstructs and sends the complete conversation history. The runtime does not send previous_response_id and sets store: false.
This substantially increases request tokens for long-running and resumed sessions.
Versions tested
GitHub.Copilot.SDK1.0.5 with Copilot CLI 1.0.73GitHub.Copilot.SDK1.0.9-preview.1 with Copilot CLI 1.0.74- Azure AI Foundry OpenAI-compatible provider
wireApi: responses
The preview SDK references CLI 1.0.76-5, but that package was not available for testing.
Observed behavior
A privacy-safe request probe showed:
- Initial request: 1 input item
- Tool continuation: 3 input items
- Next user turn: 5 input items
- Resumed session in a new process: 7 input items
No request included previous_response_id. The runtime also emitted store: false.
In a real long-running session, this resulted in approximately 26K–28K reported input tokens per request, including tool continuations.
Expected behavior
After the initial Responses request:
- Set
store: true, or otherwise use provider-supported response retention. - Capture the terminal response ID.
- Send subsequent model rounds with:
previous_response_id- only newly added input items
- Preserve instructions, tools, and request settings as required by the Responses API.
- Fall back to full history if the provider rejects or cannot resolve the response ID.
This should apply to both tool-result continuations and subsequent user turns.
Workaround validation
We implemented an experimental request handler that:
- changes
store: falsetostore: true, - captures IDs from terminal SSE response events,
- adds
previous_response_id, - replaces reconstructed history with incremental input,
- falls back to full history when chaining cannot be verified.
Live validation reduced:
- a tool continuation from 60 input items to 1,
- a subsequent user turn from 66 input items to 1.
Conversation context and tool behavior remained correct.
The handler also had to account for non-semantic differences when the CLI reconstructed response items:
- regenerated top-level response item
id, - omitted assistant-message
phase, - omitted output-text
logprobs.
Semantic content and tool call_id values were still compared exactly.
Request
Could native Responses API chaining be added to the Copilot CLI/runtime and exposed or enabled through the SDK?
It would also be useful to clarify:
- whether the SDK’s
PreviousResponseIdprotocol field is currently used by any provider path, - how response IDs should persist across SDK session resumes or process restarts,
- whether token telemetry can report the actual rewritten wire input rather than reconstructed local history.
- Lingua principale
- TypeScript
- Stelle
- 10.5k
- Fork
- 1.5k
- Merge medio
- 1g 6h
- PR unite (30g)
- 107
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/copilot-sdk
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
github/copilot-sdk#2798 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
github/copilot-sdk#2793 ·
I maintainer di solito rispondono entro 1 giorno
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
github/copilot-sdk#2782 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
github/copilot-sdk#2781 ·
I maintainer di solito rispondono entro 1 giorno
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
github/copilot-sdk#2779 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di github/copilot-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
siyuan-note/siyuan#20040 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RunestoneInteractive/rs#1574 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
remotion-dev/remotion#11901 ·
I maintainer di solito rispondono entro 1 giorno
-
Poll constructor throws for an uncached channel while resolving a message context-menu interactionApertabug need repro packages:discord.js
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
discordjs/discord.js#11645 ·
I maintainer di solito rispondono entro 3 giorni
-
🐞 bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Sitecore/content-sdk#641 ·
I maintainer di solito rispondono entro 2 giorni