@@ -102,7 +102,36 @@ export async function runChannelsAddWizardFlow(params: ChannelsAddWizardFlowPara
102102 resolvedPlugins . set ( channel , plugin ) ;
103103 } ,
104104 } ) ;
105+ const commitWizardConfig = async ( config : OpenClawConfig ) => {
106+ await params . beforePersistentEffect ?.( ) ;
107+ const committed = await commitConfigWithPendingPluginInstalls ( {
108+ nextConfig : config ,
109+ ...( baseHash !== undefined ? { baseHash } : { } ) ,
110+ } ) ;
111+ if ( committed . movedInstallRecords ) {
112+ await refreshPluginRegistryAfterConfigMutation ( {
113+ config : committed . config ,
114+ reason : "source-changed" ,
115+ installRecords : committed . installRecords ,
116+ logger : { warn : ( message ) => runtime . log ( message ) } ,
117+ } ) ;
118+ }
119+ await onboardChannels . runCollectedChannelOnboardingPostWriteHooks ( {
120+ hooks : postWriteHooks . drain ( ) ,
121+ cfg : committed . config ,
122+ runtime,
123+ ...( params . beforePersistentEffect
124+ ? { beforePersistentEffect : params . beforePersistentEffect }
125+ : { } ) ,
126+ } ) ;
127+ return committed . config ;
128+ } ;
105129 if ( selection . length === 0 ) {
130+ if ( nextConfig !== cfg ) {
131+ await commitWizardConfig ( nextConfig ) ;
132+ await prompter . outro ( "Channels updated." ) ;
133+ return ;
134+ }
106135 await prompter . outro ( "No channel changes made." ) ;
107136 return ;
108137 }
@@ -198,28 +227,7 @@ export async function runChannelsAddWizardFlow(params: ChannelsAddWizardFlowPara
198227 }
199228 }
200229
201- await params . beforePersistentEffect ?.( ) ;
202- const committed = await commitConfigWithPendingPluginInstalls ( {
203- nextConfig,
204- ...( baseHash !== undefined ? { baseHash } : { } ) ,
205- } ) ;
206- const writtenConfig = committed . config ;
207- if ( committed . movedInstallRecords ) {
208- await refreshPluginRegistryAfterConfigMutation ( {
209- config : writtenConfig ,
210- reason : "source-changed" ,
211- installRecords : committed . installRecords ,
212- logger : { warn : ( message ) => runtime . log ( message ) } ,
213- } ) ;
214- }
215- await onboardChannels . runCollectedChannelOnboardingPostWriteHooks ( {
216- hooks : postWriteHooks . drain ( ) ,
217- cfg : writtenConfig ,
218- runtime,
219- ...( params . beforePersistentEffect
220- ? { beforePersistentEffect : params . beforePersistentEffect }
221- : { } ) ,
222- } ) ;
230+ await commitWizardConfig ( nextConfig ) ;
223231 params . onConfigured ?.(
224232 selection . map ( ( channel ) => ( {
225233 channel,
0 commit comments