mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-20 00:04:52 +01:00
fix: only keep aborted messages if they have sufficient parts (#2651)
This commit is contained in:
@@ -281,9 +281,19 @@ export namespace SessionPrompt {
|
|||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
...MessageV2.toModelMessage(
|
...MessageV2.toModelMessage(
|
||||||
msgs.filter(
|
msgs.filter((m) => {
|
||||||
(m) => !(m.info.role === "assistant" && m.info.error && !MessageV2.AbortedError.isInstance(m.info.error)),
|
if (m.info.role !== "assistant" || m.info.error === undefined) {
|
||||||
),
|
return true
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
MessageV2.AbortedError.isInstance(m.info.error) &&
|
||||||
|
m.parts.some((part) => part.type !== "step-start" && part.type !== "reasoning")
|
||||||
|
) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
tools: model.info.tool_call === false ? undefined : tools,
|
tools: model.info.tool_call === false ? undefined : tools,
|
||||||
|
|||||||
Reference in New Issue
Block a user