mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-08 03:07:53 +00:00
Include reasoning messages in cloud tasks (#8401)
This commit is contained in:
parent
e33efc6242
commit
c552027960
1 changed files with 16 additions and 0 deletions
|
|
@ -2252,6 +2252,22 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
|
|||
// Note: updateApiReqMsg() is now called from within drainStreamInBackgroundToFindAllUsage
|
||||
// to ensure usage data is captured even when the stream is interrupted. The background task
|
||||
// uses local variables to accumulate usage data before atomically updating the shared state.
|
||||
|
||||
// Complete the reasoning message if it exists
|
||||
// We can't use say() here because the reasoning message may not be the last message
|
||||
// (other messages like text blocks or tool uses may have been added after it during streaming)
|
||||
if (reasoningMessage) {
|
||||
const lastReasoningIndex = findLastIndex(
|
||||
this.clineMessages,
|
||||
(m) => m.type === "say" && m.say === "reasoning",
|
||||
)
|
||||
|
||||
if (lastReasoningIndex !== -1 && this.clineMessages[lastReasoningIndex].partial) {
|
||||
this.clineMessages[lastReasoningIndex].partial = false
|
||||
await this.updateClineMessage(this.clineMessages[lastReasoningIndex])
|
||||
}
|
||||
}
|
||||
|
||||
await this.persistGpt5Metadata(reasoningMessage)
|
||||
await this.saveClineMessages()
|
||||
await this.providerRef.deref()?.postStateToWebview()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue