@@ -540,7 +540,10 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
540540 return cline
541541 }
542542
543- public async initClineWithHistoryItem ( historyItem : HistoryItem & { rootTask ?: Cline ; parentTask ?: Cline } ) {
543+ public async initClineWithHistoryItem (
544+ historyItem : HistoryItem & { rootTask ?: Cline ; parentTask ?: Cline } ,
545+ options ?: { creatorModeConfig ?: CreatorModeConfig }
546+ ) {
544547 await this . removeClineFromStack ( )
545548
546549 const {
@@ -571,6 +574,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
571574 parentTask : historyItem . parentTask ,
572575 taskNumber : historyItem . number ,
573576 onCreated : ( cline ) => this . emit ( "clineCreated" , cline ) ,
577+ creatorModeConfig : options ?. creatorModeConfig ,
574578 } )
575579
576580 await this . addClineToStack ( cline )
@@ -886,6 +890,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
886890 // Preserve parent and root task information for history item.
887891 const rootTask = cline . rootTask
888892 const parentTask = cline . parentTask
893+ const creatorModeConfig = cline . creatorModeConfig
889894
890895 cline . abortTask ( )
891896
@@ -913,7 +918,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
913918 }
914919
915920 // Clears task again, so we need to abortTask manually above.
916- await this . initClineWithHistoryItem ( { ...historyItem , rootTask, parentTask } )
921+ await this . initClineWithHistoryItem ( { ...historyItem , rootTask, parentTask } , { creatorModeConfig } )
917922 }
918923
919924 async updateCustomInstructions ( instructions ?: string ) {
@@ -1101,7 +1106,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
11011106 if ( id !== this . getCurrentCline ( ) ?. taskId ) {
11021107 // Non-current task.
11031108 const { historyItem } = await this . getTaskWithId ( id )
1104- await this . initClineWithHistoryItem ( historyItem ) // Clears existing task.
1109+ const creatorModeConfig = this . getCurrentCline ( ) ?. creatorModeConfig
1110+ await this . initClineWithHistoryItem ( historyItem , { creatorModeConfig } ) // Clears existing task.
11051111 }
11061112
11071113 await this . postMessageToWebview ( { type : "action" , action : "chatButtonClicked" } )
@@ -1243,10 +1249,9 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
12431249 historyPreviewCollapsed,
12441250 } = await this . getState ( )
12451251
1246- // Construct API configuration with creator mode
1252+ const creatorModeConfig = currentCline ?. creatorModeConfig ;
12471253 const apiConfiguration = {
1248- ...baseApiConfiguration ,
1249- creatorModeConfig : currentCline ?. creatorModeConfig ,
1254+ ...baseApiConfiguration
12501255 }
12511256
12521257 const telemetryKey = process . env . POSTHOG_API_KEY
@@ -1334,6 +1339,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
13341339 terminalCompressProgressBar : terminalCompressProgressBar ?? true ,
13351340 hasSystemPromptOverride,
13361341 historyPreviewCollapsed : historyPreviewCollapsed ?? false ,
1342+ creatorModeConfig,
13371343 }
13381344 }
13391345
0 commit comments