github / github/copilot-sdk

Responses API retries reference non-persisted items (store=false) with no way to enable store in .NET SDK

未关闭
#357 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug sdk/dotnet
主要语言
Java
星标
10.5k
派生
1.5k
平均合并
1 天 11 小时
30 天内合并 PR
128

描述

### Summary

When using **GitHub.Copilot.SDK for .NET (v0.1.21)** with `WireApi = "responses"`, the SDK may retry or continue a session using response item IDs (e.g. `rs_...`) even though the underlying request is sent with `store=false`.

Because the .NET SDK does **not expose any way to set `store=true`**, this results in unrecoverable 400 errors:

```
CAPIError: 400 Item with id 'rs_...' not found.
Items are not persisted when `store` is set to false.
Try again with `store` set to true, or remove this item from your input.
```

At the moment, **there is no way for a .NET SDK user to resolve this**, even though the error message explicitly instructs to set `store=true`.

---

### Environment

* GitHub.Copilot.SDK: **0.1.21**
* .NET: **net8.0**
* Provider: **Azure OpenAI**
* Wire API: **responses**
* Model: `gpt-5.2-codex`
* ReasoningEffort: `xhigh`

---

### Root Cause

* The **Responses API** requires `store=true` if response items are later referenced (e.g. via retry or continuation).
* The **.NET SDK MessageOptions does not expose a `Store` property**:

```csharp
public class MessageOptions
{
public string Prompt { get; set; }
public List? Attachments { get; set; }
public string? Mode { get; set; }
}
```

* As a result, all requests are effectively sent with `store=false`.
* The SDK/runtime still retries or chains requests using response item IDs (`rs_...`), which cannot be resolved.

This creates a **hard failure with no user-level workaround**.

---

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。