fix(core): strip stale response item IDs before serialization
This commit is contained in:
parent
23483ea013
commit
73ee68b6a2
5 changed files with 207 additions and 23 deletions
|
|
@ -163,7 +163,35 @@ describe("convertToOpenAIResponsesInput", () => {
|
|||
])
|
||||
})
|
||||
|
||||
test("drops reasoning items with no copilot itemId and warns, as before", async () => {
|
||||
test("preserves encrypted reasoning with no copilot itemId", async () => {
|
||||
const { input, warnings } = await convertToOpenAIResponsesInput({
|
||||
prompt: [
|
||||
{
|
||||
role: "assistant",
|
||||
content: [
|
||||
{
|
||||
type: "reasoning",
|
||||
text: "thinking...",
|
||||
providerOptions: { copilot: { reasoningEncryptedContent: "enc_1" } },
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
systemMessageMode: "system",
|
||||
store: false,
|
||||
})
|
||||
|
||||
expect(warnings).toEqual([])
|
||||
expect(input).toEqual([
|
||||
{
|
||||
type: "reasoning",
|
||||
encrypted_content: "enc_1",
|
||||
summary: [{ type: "summary_text", text: "thinking..." }],
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
test("drops reasoning with neither a copilot itemId nor encrypted content", async () => {
|
||||
const { input, warnings } = await convertToOpenAIResponsesInput({
|
||||
prompt: [
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue