@@ -91,7 +91,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
9191 this . dispose ( )
9292
9393 throw new Error (
94- `Roo Code <Language Model API>: Failed to initialize handler: ${ error instanceof Error ? error . message : "Unknown error" } ` ,
94+ `Datacoves Copilot <Language Model API>: Failed to initialize handler: ${ error instanceof Error ? error . message : "Unknown error" } ` ,
9595 )
9696 }
9797 }
@@ -106,17 +106,17 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
106106 try {
107107 // Check if the client is already initialized
108108 if ( this . client ) {
109- console . debug ( "Roo Code <Language Model API>: Client already initialized" )
109+ console . debug ( "Datacoves Copilot <Language Model API>: Client already initialized" )
110110 return
111111 }
112112 // Create a new client instance
113113 this . client = await this . createClient ( this . options . vsCodeLmModelSelector || { } )
114- console . debug ( "Roo Code <Language Model API>: Client initialized successfully" )
114+ console . debug ( "Datacoves Copilot <Language Model API>: Client initialized successfully" )
115115 } catch ( error ) {
116116 // Handle errors during client initialization
117117 const errorMessage = error instanceof Error ? error . message : "Unknown error"
118- console . error ( "Roo Code <Language Model API>: Client initialization failed:" , errorMessage )
119- throw new Error ( `Roo Code <Language Model API>: Failed to initialize client: ${ errorMessage } ` )
118+ console . error ( "Datacoves Copilot <Language Model API>: Client initialization failed:" , errorMessage )
119+ throw new Error ( `Datacoves Copilot <Language Model API>: Failed to initialize client: ${ errorMessage } ` )
120120 }
121121 }
122122 /**
@@ -164,7 +164,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
164164 }
165165 } catch ( error ) {
166166 const errorMessage = error instanceof Error ? error . message : "Unknown error"
167- throw new Error ( `Roo Code <Language Model API>: Failed to select model: ${ errorMessage } ` )
167+ throw new Error ( `Datacoves Copilot <Language Model API>: Failed to select model: ${ errorMessage } ` )
168168 }
169169 }
170170
@@ -225,18 +225,18 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
225225 private async internalCountTokens ( text : string | vscode . LanguageModelChatMessage ) : Promise < number > {
226226 // Check for required dependencies
227227 if ( ! this . client ) {
228- console . warn ( "Roo Code <Language Model API>: No client available for token counting" )
228+ console . warn ( "Datacoves Copilot <Language Model API>: No client available for token counting" )
229229 return 0
230230 }
231231
232232 if ( ! this . currentRequestCancellation ) {
233- console . warn ( "Roo Code <Language Model API>: No cancellation token available for token counting" )
233+ console . warn ( "Datacoves Copilot <Language Model API>: No cancellation token available for token counting" )
234234 return 0
235235 }
236236
237237 // Validate input
238238 if ( ! text ) {
239- console . debug ( "Roo Code <Language Model API>: Empty text provided for token counting" )
239+ console . debug ( "Datacoves Copilot <Language Model API>: Empty text provided for token counting" )
240240 return 0
241241 }
242242
@@ -249,37 +249,37 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
249249 } else if ( text instanceof vscode . LanguageModelChatMessage ) {
250250 // For chat messages, ensure we have content
251251 if ( ! text . content || ( Array . isArray ( text . content ) && text . content . length === 0 ) ) {
252- console . debug ( "Roo Code <Language Model API>: Empty chat message content" )
252+ console . debug ( "Datacoves Copilot <Language Model API>: Empty chat message content" )
253253 return 0
254254 }
255255 const countMessage = extractTextCountFromMessage ( text )
256256 tokenCount = await this . client . countTokens ( countMessage , this . currentRequestCancellation . token )
257257 } else {
258- console . warn ( "Roo Code <Language Model API>: Invalid input type for token counting" )
258+ console . warn ( "Datacoves Copilot <Language Model API>: Invalid input type for token counting" )
259259 return 0
260260 }
261261
262262 // Validate the result
263263 if ( typeof tokenCount !== "number" ) {
264- console . warn ( "Roo Code <Language Model API>: Non-numeric token count received:" , tokenCount )
264+ console . warn ( "Datacoves Copilot <Language Model API>: Non-numeric token count received:" , tokenCount )
265265 return 0
266266 }
267267
268268 if ( tokenCount < 0 ) {
269- console . warn ( "Roo Code <Language Model API>: Negative token count received:" , tokenCount )
269+ console . warn ( "Datacoves Copilot <Language Model API>: Negative token count received:" , tokenCount )
270270 return 0
271271 }
272272
273273 return tokenCount
274274 } catch ( error ) {
275275 // Handle specific error types
276276 if ( error instanceof vscode . CancellationError ) {
277- console . debug ( "Roo Code <Language Model API>: Token counting cancelled by user" )
277+ console . debug ( "Datacoves Copilot <Language Model API>: Token counting cancelled by user" )
278278 return 0
279279 }
280280
281281 const errorMessage = error instanceof Error ? error . message : "Unknown error"
282- console . warn ( "Roo Code <Language Model API>: Token counting failed:" , errorMessage )
282+ console . warn ( "Datacoves Copilot <Language Model API>: Token counting failed:" , errorMessage )
283283
284284 // Log additional error details if available
285285 if ( error instanceof Error && error . stack ) {
@@ -306,7 +306,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
306306
307307 private async getClient ( ) : Promise < vscode . LanguageModelChat > {
308308 if ( ! this . client ) {
309- console . debug ( "Roo Code <Language Model API>: Getting client with options:" , {
309+ console . debug ( "Datacoves Copilot <Language Model API>: Getting client with options:" , {
310310 vsCodeLmModelSelector : this . options . vsCodeLmModelSelector ,
311311 hasOptions : ! ! this . options ,
312312 selectorKeys : this . options . vsCodeLmModelSelector ? Object . keys ( this . options . vsCodeLmModelSelector ) : [ ] ,
@@ -315,12 +315,12 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
315315 try {
316316 // Use default empty selector if none provided to get all available models
317317 const selector = this . options ?. vsCodeLmModelSelector || { }
318- console . debug ( "Roo Code <Language Model API>: Creating client with selector:" , selector )
318+ console . debug ( "Datacoves Copilot <Language Model API>: Creating client with selector:" , selector )
319319 this . client = await this . createClient ( selector )
320320 } catch ( error ) {
321321 const message = error instanceof Error ? error . message : "Unknown error"
322- console . error ( "Roo Code <Language Model API>: Client creation failed:" , message )
323- throw new Error ( `Roo Code <Language Model API>: Failed to create client: ${ message } ` )
322+ console . error ( "Datacoves Copilot <Language Model API>: Client creation failed:" , message )
323+ throw new Error ( `Datacoves Copilot <Language Model API>: Failed to create client: ${ message } ` )
324324 }
325325 }
326326
@@ -387,7 +387,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
387387 try {
388388 // Create the response stream with required options
389389 const requestOptions : vscode . LanguageModelChatRequestOptions = {
390- justification : `Roo Code would like to use '${ client . name } ' from '${ client . vendor } ', Click 'Allow' to proceed.` ,
390+ justification : `Datacoves Copilot would like to use '${ client . name } ' from '${ client . vendor } ', Click 'Allow' to proceed.` ,
391391 }
392392
393393 // Add tools to request options when using native tool protocol
@@ -406,7 +406,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
406406 if ( chunk instanceof vscode . LanguageModelTextPart ) {
407407 // Validate text part value
408408 if ( typeof chunk . value !== "string" ) {
409- console . warn ( "Roo Code <Language Model API>: Invalid text part value received:" , chunk . value )
409+ console . warn ( "Datacoves Copilot <Language Model API>: Invalid text part value received:" , chunk . value )
410410 continue
411411 }
412412
@@ -419,23 +419,23 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
419419 try {
420420 // Validate tool call parameters
421421 if ( ! chunk . name || typeof chunk . name !== "string" ) {
422- console . warn ( "Roo Code <Language Model API>: Invalid tool name received:" , chunk . name )
422+ console . warn ( "Datacoves Copilot <Language Model API>: Invalid tool name received:" , chunk . name )
423423 continue
424424 }
425425
426426 if ( ! chunk . callId || typeof chunk . callId !== "string" ) {
427- console . warn ( "Roo Code <Language Model API>: Invalid tool callId received:" , chunk . callId )
427+ console . warn ( "Datacoves Copilot <Language Model API>: Invalid tool callId received:" , chunk . callId )
428428 continue
429429 }
430430
431431 // Ensure input is a valid object
432432 if ( ! chunk . input || typeof chunk . input !== "object" ) {
433- console . warn ( "Roo Code <Language Model API>: Invalid tool input received:" , chunk . input )
433+ console . warn ( "Datacoves Copilot <Language Model API>: Invalid tool input received:" , chunk . input )
434434 continue
435435 }
436436
437437 // Log tool call for debugging
438- console . debug ( "Roo Code <Language Model API>: Processing tool call:" , {
438+ console . debug ( "Datacoves Copilot <Language Model API>: Processing tool call:" , {
439439 name : chunk . name ,
440440 callId : chunk . callId ,
441441 inputSize : JSON . stringify ( chunk . input ) . length ,
@@ -469,12 +469,12 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
469469 }
470470 }
471471 } catch ( error ) {
472- console . error ( "Roo Code <Language Model API>: Failed to process tool call:" , error )
472+ console . error ( "Datacoves Copilot <Language Model API>: Failed to process tool call:" , error )
473473 // Continue processing other chunks even if one fails
474474 continue
475475 }
476476 } else {
477- console . warn ( "Roo Code <Language Model API>: Unknown chunk type received:" , chunk )
477+ console . warn ( "Datacoves Copilot <Language Model API>: Unknown chunk type received:" , chunk )
478478 }
479479 }
480480
@@ -491,11 +491,11 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
491491 this . ensureCleanState ( )
492492
493493 if ( error instanceof vscode . CancellationError ) {
494- throw new Error ( "Roo Code <Language Model API>: Request cancelled by user" )
494+ throw new Error ( "Datacoves Copilot <Language Model API>: Request cancelled by user" )
495495 }
496496
497497 if ( error instanceof Error ) {
498- console . error ( "Roo Code <Language Model API>: Stream error details:" , {
498+ console . error ( "Datacoves Copilot <Language Model API>: Stream error details:" , {
499499 message : error . message ,
500500 stack : error . stack ,
501501 name : error . name ,
@@ -506,13 +506,13 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
506506 } else if ( typeof error === "object" && error !== null ) {
507507 // Handle error-like objects
508508 const errorDetails = JSON . stringify ( error , null , 2 )
509- console . error ( "Roo Code <Language Model API>: Stream error object:" , errorDetails )
510- throw new Error ( `Roo Code <Language Model API>: Response stream error: ${ errorDetails } ` )
509+ console . error ( "Datacoves Copilot <Language Model API>: Stream error object:" , errorDetails )
510+ throw new Error ( `Datacoves Copilot <Language Model API>: Response stream error: ${ errorDetails } ` )
511511 } else {
512512 // Fallback for unknown error types
513513 const errorMessage = String ( error )
514- console . error ( "Roo Code <Language Model API>: Unknown stream error:" , errorMessage )
515- throw new Error ( `Roo Code <Language Model API>: Response stream error: ${ errorMessage } ` )
514+ console . error ( "Datacoves Copilot <Language Model API>: Unknown stream error:" , errorMessage )
515+ throw new Error ( `Datacoves Copilot <Language Model API>: Response stream error: ${ errorMessage } ` )
516516 }
517517 }
518518 }
@@ -532,7 +532,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
532532 // Log any missing properties for debugging
533533 for ( const [ prop , value ] of Object . entries ( requiredProps ) ) {
534534 if ( ! value && value !== 0 ) {
535- console . warn ( `Roo Code <Language Model API>: Client missing ${ prop } property` )
535+ console . warn ( `Datacoves Copilot <Language Model API>: Client missing ${ prop } property` )
536536 }
537537 }
538538
@@ -565,7 +565,7 @@ export class VsCodeLmHandler extends BaseProvider implements SingleCompletionHan
565565 ? stringifyVsCodeLmModelSelector ( this . options . vsCodeLmModelSelector )
566566 : "vscode-lm"
567567
568- console . debug ( "Roo Code <Language Model API>: No client available, using fallback model info" )
568+ console . debug ( "Datacoves Copilot <Language Model API>: No client available, using fallback model info" )
569569
570570 return {
571571 id : fallbackId ,
0 commit comments