fix issue continuing session after aborted

This commit is contained in:
Dax Raad
2025-06-14 20:24:50 -04:00
parent bfd4269d7d
commit 783faf554d

View File

@@ -446,26 +446,28 @@ export namespace Session {
content: x, content: x,
}), }),
), ),
...msgs.flatMap((msg): CoreMessage[] => { ...msgs
switch (msg.role) { .filter((msg) => msg.parts.length > 0)
case "user": .flatMap((msg): CoreMessage[] => {
return [ switch (msg.role) {
{ case "user":
role: "user", return [
content: toUserContent(msg.parts), {
}, role: "user",
] content: toUserContent(msg.parts),
case "assistant": },
return [ ]
{ case "assistant":
role: "assistant", return [
content: toAssistantContent(msg.parts), {
}, role: "assistant",
] content: toAssistantContent(msg.parts),
default: },
return [] ]
} default:
}), return []
}
}),
], ],
temperature: model.info.id === "codex-mini-latest" ? undefined : 0, temperature: model.info.id === "codex-mini-latest" ? undefined : 0,
tools: { tools: {