mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Get rid of "partial" component in names referencing not necessarily partial messages (#4332)
This commit is contained in:
parent
6f21103545
commit
d1876d6af7
3 changed files with 11 additions and 11 deletions
|
|
@ -340,17 +340,17 @@ export class Task extends EventEmitter<ClineEvents> {
|
|||
await this.saveClineMessages()
|
||||
}
|
||||
|
||||
private async updateClineMessage(partialMessage: ClineMessage) {
|
||||
private async updateClineMessage(message: ClineMessage) {
|
||||
const provider = this.providerRef.deref()
|
||||
await provider?.postMessageToWebview({ type: "partialMessage", partialMessage })
|
||||
this.emit("message", { action: "updated", message: partialMessage })
|
||||
await provider?.postMessageToWebview({ type: "messageUpdated", clineMessage: message })
|
||||
this.emit("message", { action: "updated", message })
|
||||
|
||||
const shouldCaptureMessage = partialMessage.partial !== true && CloudService.isEnabled()
|
||||
const shouldCaptureMessage = message.partial !== true && CloudService.isEnabled()
|
||||
|
||||
if (shouldCaptureMessage) {
|
||||
CloudService.instance.captureEvent({
|
||||
event: TelemetryEventName.TASK_MESSAGE,
|
||||
properties: { taskId: this.taskId, message: partialMessage },
|
||||
properties: { taskId: this.taskId, message },
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ export interface ExtensionMessage {
|
|||
| "theme"
|
||||
| "workspaceUpdated"
|
||||
| "invoke"
|
||||
| "partialMessage"
|
||||
| "messageUpdated"
|
||||
| "mcpServers"
|
||||
| "enhancedPrompt"
|
||||
| "commitSearchResults"
|
||||
|
|
@ -92,7 +92,7 @@ export interface ExtensionMessage {
|
|||
isActive: boolean
|
||||
path?: string
|
||||
}>
|
||||
partialMessage?: ClineMessage
|
||||
clineMessage?: ClineMessage
|
||||
routerModels?: RouterModels
|
||||
openAiModels?: string[]
|
||||
ollamaModels?: string[]
|
||||
|
|
|
|||
|
|
@ -263,14 +263,14 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
|
|||
setOpenedTabs(tabs)
|
||||
break
|
||||
}
|
||||
case "partialMessage": {
|
||||
const partialMessage = message.partialMessage!
|
||||
case "messageUpdated": {
|
||||
const clineMessage = message.clineMessage!
|
||||
setState((prevState) => {
|
||||
// worth noting it will never be possible for a more up-to-date message to be sent here or in normal messages post since the presentAssistantContent function uses lock
|
||||
const lastIndex = findLastIndex(prevState.clineMessages, (msg) => msg.ts === partialMessage.ts)
|
||||
const lastIndex = findLastIndex(prevState.clineMessages, (msg) => msg.ts === clineMessage.ts)
|
||||
if (lastIndex !== -1) {
|
||||
const newClineMessages = [...prevState.clineMessages]
|
||||
newClineMessages[lastIndex] = partialMessage
|
||||
newClineMessages[lastIndex] = clineMessage
|
||||
return { ...prevState, clineMessages: newClineMessages }
|
||||
}
|
||||
return prevState
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue