diff --git a/agent/app/service/agents_utils.go b/agent/app/service/agents_utils.go index 8ea2f1ae2609..1f335ca7169f 100644 --- a/agent/app/service/agents_utils.go +++ b/agent/app/service/agents_utils.go @@ -386,6 +386,10 @@ func buildAgentItem(agent *model.Agent, appInstall *model.AppInstall, envMap map return item } +func isAgentAppKey(appKey string) bool { + return appKey == constant.AppOpenclaw || appKey == constant.AppCopaw || appKey == constant.AppHermesAgent +} + func isOpenclawLegacyHTTPVersion(version string) bool { return !common.CompareAppVersion(version, openclawHTTPSVersion) } diff --git a/agent/app/service/app_utils.go b/agent/app/service/app_utils.go index 97f849e1f1e7..ed1dac705141 100644 --- a/agent/app/service/app_utils.go +++ b/agent/app/service/app_utils.go @@ -392,7 +392,7 @@ func deleteAppInstall(deleteReq request.AppInstallDelete) error { return err } appKey := install.App.Key - if appKey == constant.AppOpenclaw || appKey == constant.AppCopaw { + if isAgentAppKey(appKey) { _ = agentRepo.DeleteByAppInstallIDWithCtx(ctx, install.ID) } diff --git a/agent/app/service/website.go b/agent/app/service/website.go index 3be6051002eb..d2c7482c6a48 100644 --- a/agent/app/service/website.go +++ b/agent/app/service/website.go @@ -379,6 +379,17 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) (err error) req request.AppInstallCreate install *model.AppInstall ) + appDetail, err := appDetailRepo.GetFirst(repo.WithByID(create.AppInstall.AppDetailId)) + if err != nil { + return err + } + app, err := appRepo.GetFirst(repo.WithByID(appDetail.AppId)) + if err != nil { + return err + } + if isAgentAppKey(app.Key) { + return fmt.Errorf("%s does not support website deployment", app.Key) + } req.Name = create.AppInstall.Name req.AppDetailId = create.AppInstall.AppDetailId req.Params = create.AppInstall.Params diff --git a/frontend/src/views/website/website/create/index.vue b/frontend/src/views/website/website/create/index.vue index 914974a7334c..55ec563b1cc2 100644 --- a/frontend/src/views/website/website/create/index.vue +++ b/frontend/src/views/website/website/create/index.vue @@ -68,7 +68,7 @@ :key="index" :label="app.name" :value="app.id" - :disabled="app.key == 'openclaw'" + :disabled="isRestrictedDeploymentApp(app.key)" > @@ -694,6 +694,10 @@ const getProxyTargetFromApp = (app: Pick { + return appKey === 'openclaw' || appKey === 'copaw' || appKey === 'hermes-agent'; +}; + const changeInstall = () => { appInstalls.value.forEach((app) => { if (app.id === website.value.appInstallId) { @@ -708,7 +712,7 @@ const searchAppList = () => { searchApp(appReq).then((res) => { apps.value = res.data.items; - const selectableApp = res.data.items.find((item) => item.key !== 'openclaw'); + const selectableApp = res.data.items.find((item) => !isRestrictedDeploymentApp(item.key)); if (selectableApp) { website.value.appinstall.appId = selectableApp.id; website.value.appinstall.appkey = selectableApp.key;