Skip to content

Commit 3ecf73d

Browse files
committed
fix: preserve reasoning summary field
1 parent 9a82401 commit 3ecf73d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/core/task/__tests__/apiConversationHistory.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("prepareApiConversationMessage", () => {
3535
])
3636
})
3737

38-
it("prepends non-Anthropic reasoning blocks without dead summary fallback", () => {
38+
it("preserves non-Anthropic reasoning block shape", () => {
3939
const result = prepareApiConversationMessage({
4040
message: { role: "assistant", content: "answer" },
4141
reasoning: "visible reasoning",
@@ -45,10 +45,9 @@ describe("prepareApiConversationMessage", () => {
4545
}) as any
4646

4747
expect(result.content).toEqual([
48-
{ type: "reasoning", text: "visible reasoning" },
48+
{ type: "reasoning", text: "visible reasoning", summary: [] },
4949
{ type: "text", text: "answer" },
5050
])
51-
expect(result.content[0]).not.toHaveProperty("summary")
5251
})
5352

5453
it("preserves encrypted reasoning content", () => {

src/core/task/apiConversationHistory.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ function prepareAssistantMessage(
7777
const reasoningBlock = {
7878
type: "reasoning",
7979
text: reasoning,
80+
summary: [] as any[],
8081
}
8182

8283
prependContentBlock(messageWithTs, reasoningBlock)

0 commit comments

Comments
 (0)