@@ -501,6 +501,15 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
501501 experiments,
502502 } = await this . getState ( )
503503
504+ // Update API configuration with creator mode
505+ await this . updateApiConfiguration ( {
506+ ...apiConfiguration ,
507+ creatorMode,
508+ } )
509+
510+ // Post updated state to webview immediately
511+ await this . postStateToWebview ( )
512+
504513 const modePrompt = customModePrompts ?. [ mode ] as PromptComponent
505514 const effectiveInstructions = [ globalInstructions , modePrompt ?. customInstructions ] . filter ( Boolean ) . join ( "\n\n" )
506515
@@ -524,6 +533,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
524533 rootTask : this . clineStack . length > 0 ? this . clineStack [ 0 ] : undefined ,
525534 parentTask,
526535 taskNumber : this . clineStack . length + 1 ,
536+ creatorMode,
527537 } )
528538
529539 await this . addClineToStack ( cline )
@@ -2175,6 +2185,13 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
21752185 private async updateApiConfiguration ( apiConfiguration : ApiConfiguration ) {
21762186 // Update mode's default config.
21772187 const { mode } = await this . getState ( )
2188+ const currentCline = this . getCurrentCline ( )
2189+
2190+ // Preserve creator mode when updating configuration
2191+ const updatedConfig = {
2192+ ...apiConfiguration ,
2193+ creatorMode : currentCline ?. creatorMode ,
2194+ }
21782195
21792196 if ( mode ) {
21802197 const currentApiConfigName = await this . getGlobalState ( "currentApiConfigName" )
@@ -2186,7 +2203,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
21862203 }
21872204 }
21882205
2189- await this . contextProxy . setApiConfiguration ( apiConfiguration )
2206+ await this . contextProxy . setApiConfiguration ( updatedConfig )
21902207
21912208 if ( this . getCurrentCline ( ) ) {
21922209 this . getCurrentCline ( ) ! . api = buildApiHandler ( apiConfiguration )
@@ -2511,8 +2528,10 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
25112528 }
25122529
25132530 async getStateToPostToWebview ( ) {
2531+ const currentCline = this . getCurrentCline ( )
2532+ // Get base state
25142533 const {
2515- apiConfiguration,
2534+ apiConfiguration : baseApiConfiguration ,
25162535 lastShownAnnouncementId,
25172536 customInstructions,
25182537 alwaysAllowReadOnly,
@@ -2560,6 +2579,12 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
25602579 maxReadFileLine,
25612580 } = await this . getState ( )
25622581
2582+ // Construct API configuration with creator mode
2583+ const apiConfiguration = {
2584+ ...baseApiConfiguration ,
2585+ creatorMode : currentCline ?. creatorMode ,
2586+ }
2587+
25632588 const telemetryKey = process . env . POSTHOG_API_KEY
25642589 const machineId = vscode . env . machineId
25652590 const allowedCommands = vscode . workspace . getConfiguration ( "roo-cline" ) . get < string [ ] > ( "allowedCommands" ) || [ ]
0 commit comments