Responses API should support native `previous_response_id` chaining
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 35/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 領域
- api, backend-api-design, cli
研究方向
先追蹤 Responses API 的請求路徑和 SDK 的通訊協定欄位 PreviousResponseId,然後比較工具延續、後續使用者回合和恢復的工作階段。完成的標準是:受支援的提供者使用保留的回應 ID 搭配增量輸入、保留必要的設定、在鏈結失敗時回退到完整歷史記錄,並確保內容脈絡與工具行為正確。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- TypeScript
- 星號
- 10.6k
- 分支
- 1.5k
- 平均合併
- 10 小時 8 分鐘
- 30 天內合併 PR
- 4
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/copilot-sdk 的其他 Issue
-
Clarify SDK architecture and in-process runtime transport可能已有人在做 @KalebCole 於 19 天前認領。 未關閉documentation
難度 1/5 1 小時以內 新手友好度 92/100
github/copilot-sdk#2804 · 1 則留言 ·
維護者通常 1 天內回覆
-
Python ModelLimits drops max_output_tokens from model metadata可能已有人在做 @HDMowri 於 20 天前認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 78/100
github/copilot-sdk#2798 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
github/copilot-sdk#2793 ·
維護者通常 1 天內回覆
-
agentic-workflows
難度 2/5 1-3 小時 新手友好度 68/100
github/copilot-sdk#2782 ·
維護者通常 1 天內回覆
-
agentic-workflows
難度 2/5 1-3 小時 新手友好度 65/100
github/copilot-sdk#2779 ·
維護者通常 1 天內回覆
查看 github/copilot-sdk 的全部 Issue
相似的 Issue
-
area:editor bug issue-form:bug P0 platform:windows review: low
難度 2/5 1-3 小時 新手友好度 64/100
1lck/Lithe-IDEA#1388 ·
維護者通常 1 天內回覆
-
fix(api): isToolAuditEnabled swallows database read errors on auditToolOperations without logging未關閉area: backend bug priority: low
難度 2/5 1-3 小時 新手友好度 82/100
snapotter-hq/SnapOtter#3238 ·
維護者通常 1 天內回覆
-
rig up --plan times out after 5 s and reports an UNKNOWN outcome while the daemon completes the plan未關閉
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
modelcontextprotocol/servers#5216 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆