@@ -2752,6 +2752,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
27522752 const currentItem = stack . pop ( ) !
27532753 const currentUserContent = currentItem . userContent
27542754 const currentIncludeFileDetails = currentItem . includeFileDetails
2755+ console . log (
2756+ `[E2EDEBUG] Task#${ this . taskId } recursivelyMakeClineRequests pop retryAttempt=${ currentItem . retryAttempt ?? 0 } blocks=${ currentUserContent . length } ` ,
2757+ )
27552758
27562759 if ( this . abort ) {
27572760 throw new Error ( `[RooCode#recursivelyMakeRooRequests] task ${ this . taskId } .${ this . instanceId } aborted` )
@@ -2816,13 +2819,15 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
28162819 // provider rate-limit window.
28172820 await this . maybeWaitForProviderRateLimit ( currentItem . retryAttempt ?? 0 )
28182821 this . rateLimitClock . recordRequest ( )
2822+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude rate-limit recorded` )
28192823
28202824 await this . say (
28212825 "api_req_started" ,
28222826 JSON . stringify ( {
28232827 apiProtocol,
28242828 } ) ,
28252829 )
2830+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude api_req_started posted` )
28262831
28272832 const provider = this . providerRef . deref ( )
28282833 const state = provider ? await provider . getState ( ) : undefined
@@ -2831,6 +2836,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
28312836 const includeDiagnosticMessages = state ?. includeDiagnosticMessages ?? true
28322837 const maxDiagnosticMessages = state ?. maxDiagnosticMessages ?? 50
28332838 const currentMode = await this . getTaskMode ( )
2839+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude taskMode=${ currentMode } ` )
28342840
28352841 const { content : parsedUserContent , mode : slashCommandMode } = await processUserContentMentions ( {
28362842 userContent : currentUserContent ,
@@ -2843,6 +2849,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
28432849 skillsManager : provider ?. getSkillsManager ( ) ,
28442850 currentMode,
28452851 } )
2852+ console . log (
2853+ `[E2EDEBUG] Task#${ this . taskId } prelude processUserContentMentions done slashMode=${ slashCommandMode ?? "none" } ` ,
2854+ )
28462855
28472856 // Switch mode if specified in a slash command's frontmatter
28482857 if ( slashCommandMode ) {
@@ -2857,6 +2866,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
28572866 }
28582867
28592868 const environmentDetails = await getEnvironmentDetails ( this , currentIncludeFileDetails )
2869+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude environmentDetails built` )
28602870
28612871 // Remove any existing environment_details blocks before adding fresh ones.
28622872 // This prevents duplicate environment details when resuming tasks,
@@ -2889,6 +2899,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
28892899 await this . addToApiConversationHistory ( { role : "user" , content : finalUserContent } )
28902900 this . messageCounts . user ++
28912901 }
2902+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude history updated shouldAdd=${ shouldAddUserMessage } ` )
28922903
28932904 // Since we sent off a placeholder api_req_started message to update the
28942905 // webview while waiting to actually start the API request (to load
@@ -2902,6 +2913,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
29022913
29032914 await this . saveClineMessages ( )
29042915 await this . providerRef . deref ( ) ?. postStateToWebviewWithoutTaskHistory ( )
2916+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude messages saved + state posted` )
29052917
29062918 try {
29072919 let cacheWriteTokens = 0
@@ -3008,8 +3020,10 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
30083020 NativeToolCallParser . clearRawChunkState ( )
30093021
30103022 await this . diffViewProvider . reset ( )
3023+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude diffViewProvider reset` )
30113024
30123025 await this . safeEnsureModelFetched ( )
3026+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude safeEnsureModelFetched done` )
30133027
30143028 // Cache model info once per API request to avoid repeated calls during streaming
30153029 // This is especially important for tools and background usage collection
@@ -3020,6 +3034,7 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
30203034 // Yields only if the first chunk is successful, otherwise will
30213035 // allow the user to retry the request (most likely due to rate
30223036 // limit error, which gets thrown on the first chunk).
3037+ console . log ( `[E2EDEBUG] Task#${ this . taskId } prelude invoking attemptApiRequest` )
30233038 const stream = this . attemptApiRequest ( currentItem . retryAttempt ?? 0 , { skipProviderRateLimit : true } )
30243039 let assistantMessage = ""
30253040 let reasoningMessage = ""
@@ -4288,6 +4303,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
42884303 retryAttempt : number = 0 ,
42894304 options : { skipProviderRateLimit ?: boolean } = { } ,
42904305 ) : ApiStream {
4306+ console . log (
4307+ `[E2EDEBUG] Task#${ this . taskId } attemptApiRequest start retry=${ retryAttempt } skipRateLimit=${ options . skipProviderRateLimit ?? false } ` ,
4308+ )
42914309 const state = await this . providerRef . deref ( ) ?. getState ( )
42924310
42934311 const {
@@ -4319,6 +4337,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
43194337
43204338 const systemPrompt = await this . getSystemPrompt ( )
43214339 const { contextTokens } = this . getTokenUsage ( )
4340+ console . log (
4341+ `[E2EDEBUG] Task#${ this . taskId } attemptApiRequest systemPrompt built contextTokens=${ contextTokens ?? "n/a" } ` ,
4342+ )
43224343
43234344 if ( contextTokens ) {
43244345 await this . safeEnsureModelFetched ( )
@@ -4587,6 +4608,9 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
45874608 // Reset the flag after using it
45884609 this . skipPrevResponseIdOnce = false
45894610
4611+ console . log (
4612+ `[E2EDEBUG] Task#${ this . taskId } attemptApiRequest calling api.createMessage history=${ cleanConversationHistory . length } tools=${ allTools . length } ` ,
4613+ )
45904614 // The provider accepts reasoning items alongside standard messages; cast to the expected parameter type.
45914615 const stream = this . api . createMessage (
45924616 systemPrompt ,
0 commit comments