File tree Expand file tree Collapse file tree
packages/opencode/src/session Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -702,23 +702,6 @@ export namespace MessageV2 {
702702 }
703703 }
704704
705- // Always strip reasoning/thinking parts from the last assistant message.
706- // Claude API enforces that thinking blocks in the latest assistant message
707- // must be byte-identical to the original response. Since OpenCode reconstructs
708- // them from stored parts, they may not match exactly. Stripping is safe because
709- // Claude doesn't need its own thinking blocks to continue the conversation.
710- {
711- const lastAssistantIdx = result . findLastIndex ( ( msg ) => msg . role === "assistant" )
712- if ( lastAssistantIdx !== - 1 ) {
713- const filtered = result [ lastAssistantIdx ] . parts . filter ( ( part ) => part . type !== "reasoning" )
714- if ( filtered . length > 0 && ! filtered . every ( ( p ) => p . type === "step-start" ) ) {
715- result [ lastAssistantIdx ] . parts = filtered
716- } else {
717- result . splice ( lastAssistantIdx , 1 )
718- }
719- }
720- }
721-
722705 const tools = Object . fromEntries ( Array . from ( toolNames ) . map ( ( toolName ) => [ toolName , { toModelOutput } ] ) )
723706
724707 return convertToModelMessages (
You canāt perform that action at this time.
0 commit comments