Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions packages/opencode/src/session/message-v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,8 @@ export namespace MessageV2 {
text: part.text,
providerMetadata: part.metadata,
})
if (part.type === "step-start")
assistantMessage.parts.push({
type: "step-start",
})
// step-start parts are not added to UIMessage since "step-start" is not a valid
// UIMessagePart type in the AI SDK - they are only used internally for tracking
if (part.type === "tool") {
if (part.state.status === "completed") {
assistantMessage.parts.push({
Expand Down Expand Up @@ -556,12 +554,9 @@ export namespace MessageV2 {
}
}

return convertToModelMessages(
result.filter((msg) => msg.parts.some((part) => part.type !== "step-start")),
{
tools: options?.tools,
},
)
return convertToModelMessages(result, {
tools: options?.tools,
})
}

export const stream = fn(Identifier.schema("session"), async function* (sessionID) {
Expand Down