@@ -320,7 +320,8 @@ export class Task extends EventEmitter<ClineEvents> {
320320
321321 private async addToClineMessages ( message : ClineMessage ) {
322322 this . clineMessages . push ( message )
323- await this . providerRef . deref ( ) ?. postStateToWebview ( )
323+ const provider = this . providerRef . deref ( )
324+ await provider ?. postStateToWebview ( )
324325 this . emit ( "message" , { action : "created" , message } )
325326 await this . saveClineMessages ( )
326327
@@ -340,7 +341,8 @@ export class Task extends EventEmitter<ClineEvents> {
340341 }
341342
342343 private async updateClineMessage ( partialMessage : ClineMessage ) {
343- await this . providerRef . deref ( ) ?. postMessageToWebview ( { type : "partialMessage" , partialMessage } )
344+ const provider = this . providerRef . deref ( )
345+ await provider ?. postMessageToWebview ( { type : "partialMessage" , partialMessage } )
344346 this . emit ( "message" , { action : "updated" , message : partialMessage } )
345347
346348 const shouldCaptureMessage = partialMessage . partial !== true && CloudService . isEnabled ( )
@@ -808,7 +810,9 @@ export class Task extends EventEmitter<ClineEvents> {
808810 if ( Array . isArray ( message . content ) ) {
809811 const newContent = message . content . map ( ( block ) => {
810812 if ( block . type === "tool_use" ) {
811- // it's important we convert to the new tool schema format so the model doesn't get confused about how to invoke tools
813+ // It's important we convert to the new tool schema
814+ // format so the model doesn't get confused about how to
815+ // invoke tools.
812816 const inputAsXml = Object . entries ( block . input as Record < string , string > )
813817 . map ( ( [ key , value ] ) => `<${ key } >\n${ value } \n</${ key } >` )
814818 . join ( "\n" )
@@ -1503,6 +1507,7 @@ export class Task extends EventEmitter<ClineEvents> {
15031507 const rooIgnoreInstructions = this . rooIgnoreController ?. getInstructions ( )
15041508
15051509 const state = await this . providerRef . deref ( ) ?. getState ( )
1510+
15061511 const {
15071512 browserViewportSize,
15081513 mode,
0 commit comments