@@ -102,17 +102,14 @@ func newServeCmd(app *App) *cobra.Command {
102102 go openclaw .StartSyncLoop (ctx , app .OpenClaw , 10 * time .Second )
103103 }
104104
105- // Auto-scan engines on startup so Explorer and other tools see
106- // locally available engines even before a manual engine.scan call.
107- if app .ToolDeps != nil && app .ToolDeps .ScanEngines != nil {
105+ // Auto-reconcile local assets on startup so Explorer, onboarding, and
106+ // UI views see locally available engines and models even after an
107+ // upgrade that skips the first-run onboarding scan.
108+ if app .ToolDeps != nil && (app .ToolDeps .ScanEngines != nil || app .ToolDeps .ScanModels != nil || app .ToolDeps .ScanExternalServices != nil ) {
108109 go func () {
109110 scanCtx , scanCancel := context .WithTimeout (ctx , 30 * time .Second )
110111 defer scanCancel ()
111- if _ , err := app .ToolDeps .ScanEngines (scanCtx , "auto" , false ); err != nil {
112- slog .Warn ("startup engine scan failed (non-fatal)" , "error" , err )
113- } else {
114- slog .Info ("startup engine scan completed" )
115- }
112+ runStartupAssetReconcile (scanCtx , app .ToolDeps )
116113 }()
117114 }
118115
@@ -228,6 +225,33 @@ func newServeCmd(app *App) *cobra.Command {
228225 return cmd
229226}
230227
228+ func runStartupAssetReconcile (ctx context.Context , deps * mcp.ToolDeps ) {
229+ if deps == nil {
230+ return
231+ }
232+ if deps .ScanEngines != nil {
233+ if _ , err := deps .ScanEngines (ctx , "auto" , false ); err != nil {
234+ slog .Warn ("startup engine scan failed (non-fatal)" , "error" , err )
235+ } else {
236+ slog .Info ("startup engine scan completed" )
237+ }
238+ }
239+ if deps .ScanModels != nil {
240+ if _ , err := deps .ScanModels (ctx ); err != nil {
241+ slog .Warn ("startup model scan failed (non-fatal)" , "error" , err )
242+ } else {
243+ slog .Info ("startup model scan completed" )
244+ }
245+ }
246+ if deps .ScanExternalServices != nil {
247+ if _ , err := deps .ScanExternalServices (ctx ); err != nil {
248+ slog .Warn ("startup external service scan failed (non-fatal)" , "error" , err )
249+ } else {
250+ slog .Info ("startup external service scan completed" )
251+ }
252+ }
253+ }
254+
231255func resolveMCPProfile (mcpEnabled bool , profile string ) (mcp.Profile , error ) {
232256 if profile == "" {
233257 return mcp .ProfileFull , nil
0 commit comments