mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44:21 +01:00
fix issue continuing session after aborted
This commit is contained in:
@@ -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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user