Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions agent/app/api/v2/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,13 @@ func (b *BaseApi) UpdateAgentTelegramConfig(c *gin.Context) {
// @Tags AI
// @Summary Get Agent Discord channel config
// @Accept json
// @Param request body dto.AgentDiscordConfigReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {object} dto.AgentDiscordConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/channel/discord/get [post]
func (b *BaseApi) GetAgentDiscordConfig(c *gin.Context) {
var req dto.AgentDiscordConfigReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down Expand Up @@ -458,13 +458,13 @@ func (b *BaseApi) UpdateAgentDiscordConfig(c *gin.Context) {
// @Tags AI
// @Summary Get Agent QQ Bot channel config
// @Accept json
// @Param request body dto.AgentWecomConfigReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {object} dto.AgentWecomConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/channel/wecom/get [post]
func (b *BaseApi) GetAgentWecomConfig(c *gin.Context) {
var req dto.AgentWecomConfigReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down Expand Up @@ -499,13 +499,13 @@ func (b *BaseApi) UpdateAgentWecomConfig(c *gin.Context) {
// @Tags AI
// @Summary Get Agent DingTalk channel config
// @Accept json
// @Param request body dto.AgentDingTalkConfigReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {object} dto.AgentDingTalkConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/channel/dingtalk/get [post]
func (b *BaseApi) GetAgentDingTalkConfig(c *gin.Context) {
var req dto.AgentDingTalkConfigReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down Expand Up @@ -540,13 +540,13 @@ func (b *BaseApi) UpdateAgentDingTalkConfig(c *gin.Context) {
// @Tags AI
// @Summary Get Agent QQ Bot channel config
// @Accept json
// @Param request body dto.AgentQQBotConfigReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {object} dto.AgentQQBotConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/channel/qqbot/get [post]
func (b *BaseApi) GetAgentQQBotConfig(c *gin.Context) {
var req dto.AgentQQBotConfigReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down Expand Up @@ -622,13 +622,13 @@ func (b *BaseApi) CheckAgentPlugin(c *gin.Context) {
// @Tags AI
// @Summary Get Agent Security config
// @Accept json
// @Param request body dto.AgentSecurityConfigReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {object} dto.AgentSecurityConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/security/get [post]
func (b *BaseApi) GetAgentSecurityConfig(c *gin.Context) {
var req dto.AgentSecurityConfigReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down Expand Up @@ -663,13 +663,13 @@ func (b *BaseApi) UpdateAgentSecurityConfig(c *gin.Context) {
// @Tags AI
// @Summary Get Agent Other config
// @Accept json
// @Param request body dto.AgentOtherConfigReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {object} dto.AgentOtherConfig
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/other/get [post]
func (b *BaseApi) GetAgentOtherConfig(c *gin.Context) {
var req dto.AgentOtherConfigReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down Expand Up @@ -745,13 +745,13 @@ func (b *BaseApi) UpdateAgentConfigFile(c *gin.Context) {
// @Tags AI
// @Summary List Agent skills
// @Accept json
// @Param request body dto.AgentSkillsReq true "request"
// @Param request body dto.AgentIDReq true "request"
// @Success 200 {array} dto.AgentSkillItem
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /ai/agents/skills/list [post]
func (b *BaseApi) ListAgentSkills(c *gin.Context) {
var req dto.AgentSkillsReq
var req dto.AgentIDReq
if err := helper.CheckBindAndValidate(&req, c); err != nil {
return
}
Expand Down
32 changes: 4 additions & 28 deletions agent/app/dto/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ type AgentOverviewReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentIDReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentOverview struct {
Snapshot AgentOverviewSnapshot `json:"snapshot"`
}
Expand Down Expand Up @@ -237,10 +241,6 @@ type AgentChannelPairingApproveReq struct {
PairingCode string `json:"pairingCode" validate:"required"`
}

type AgentWecomConfigReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentWecomConfigUpdateReq struct {
AgentID uint `json:"agentId" validate:"required"`
Enabled bool `json:"enabled"`
Expand All @@ -257,10 +257,6 @@ type AgentWecomConfig struct {
Installed bool `json:"installed"`
}

type AgentDingTalkConfigReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentDingTalkConfigUpdateReq struct {
AgentID uint `json:"agentId" validate:"required"`
Enabled bool `json:"enabled"`
Expand Down Expand Up @@ -288,10 +284,6 @@ type AgentWeixinLoginReq struct {
TaskID string `json:"taskID" validate:"required"`
}

type AgentQQBotConfigReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentQQBotConfigUpdateReq struct {
AgentID uint `json:"agentId" validate:"required"`
Enabled bool `json:"enabled"`
Expand Down Expand Up @@ -321,10 +313,6 @@ type AgentPluginStatus struct {
Installed bool `json:"installed"`
}

type AgentDiscordConfigReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentDiscordConfigUpdateReq struct {
AgentID uint `json:"agentId" validate:"required"`
Enabled bool `json:"enabled"`
Expand All @@ -342,10 +330,6 @@ type AgentDiscordConfig struct {
Proxy string `json:"proxy"`
}

type AgentSecurityConfigReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentSecurityConfigUpdateReq struct {
AgentID uint `json:"agentId" validate:"required"`
AllowedOrigins []string `json:"allowedOrigins"`
Expand All @@ -355,10 +339,6 @@ type AgentSecurityConfig struct {
AllowedOrigins []string `json:"allowedOrigins"`
}

type AgentOtherConfigReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentOtherConfigUpdateReq struct {
AgentID uint `json:"agentId" validate:"required"`
UserTimezone string `json:"userTimezone" validate:"required"`
Expand All @@ -385,10 +365,6 @@ type AgentConfigFile struct {
Content string `json:"content"`
}

type AgentSkillsReq struct {
AgentID uint `json:"agentId" validate:"required"`
}

type AgentSkillSearchReq struct {
AgentID uint `json:"agentId" validate:"required"`
Source string `json:"source" validate:"required,oneof=clawhub skillhub"`
Expand Down
18 changes: 9 additions & 9 deletions agent/app/service/agents.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ type IAgentService interface {
UpdateModelConfig(req dto.AgentModelConfigUpdateReq) error
GetOverview(req dto.AgentOverviewReq) (*dto.AgentOverview, error)
GetProviders() ([]dto.ProviderInfo, error)
GetSecurityConfig(req dto.AgentSecurityConfigReq) (*dto.AgentSecurityConfig, error)
GetSecurityConfig(req dto.AgentIDReq) (*dto.AgentSecurityConfig, error)
UpdateSecurityConfig(req dto.AgentSecurityConfigUpdateReq) error
GetOtherConfig(req dto.AgentOtherConfigReq) (*dto.AgentOtherConfig, error)
GetOtherConfig(req dto.AgentIDReq) (*dto.AgentOtherConfig, error)
UpdateOtherConfig(req dto.AgentOtherConfigUpdateReq) error
GetConfigFile(req dto.AgentConfigFileReq) (*dto.AgentConfigFile, error)
UpdateConfigFile(req dto.AgentConfigFileUpdateReq) error
ListSkills(req dto.AgentSkillsReq) ([]dto.AgentSkillItem, error)
ListSkills(req dto.AgentIDReq) ([]dto.AgentSkillItem, error)
SearchSkills(req dto.AgentSkillSearchReq) ([]dto.AgentSkillSearchItem, error)
UpdateSkill(req dto.AgentSkillUpdateReq) error
InstallSkill(req dto.AgentSkillInstallReq) error
Expand All @@ -58,14 +58,14 @@ type IAgentService interface {
UpdateFeishuConfig(req dto.AgentFeishuConfigUpdateReq) error
GetTelegramConfig(req dto.AgentTelegramConfigReq) (*dto.AgentTelegramConfig, error)
UpdateTelegramConfig(req dto.AgentTelegramConfigUpdateReq) error
GetDiscordConfig(req dto.AgentDiscordConfigReq) (*dto.AgentDiscordConfig, error)
GetDiscordConfig(req dto.AgentIDReq) (*dto.AgentDiscordConfig, error)
UpdateDiscordConfig(req dto.AgentDiscordConfigUpdateReq) error
GetWecomConfig(req dto.AgentWecomConfigReq) (*dto.AgentWecomConfig, error)
GetWecomConfig(req dto.AgentIDReq) (*dto.AgentWecomConfig, error)
UpdateWecomConfig(req dto.AgentWecomConfigUpdateReq) error
GetDingTalkConfig(req dto.AgentDingTalkConfigReq) (*dto.AgentDingTalkConfig, error)
GetDingTalkConfig(req dto.AgentIDReq) (*dto.AgentDingTalkConfig, error)
UpdateDingTalkConfig(req dto.AgentDingTalkConfigUpdateReq) error
LoginWeixinChannel(req dto.AgentWeixinLoginReq) error
GetQQBotConfig(req dto.AgentQQBotConfigReq) (*dto.AgentQQBotConfig, error)
GetQQBotConfig(req dto.AgentIDReq) (*dto.AgentQQBotConfig, error)
UpdateQQBotConfig(req dto.AgentQQBotConfigUpdateReq) error
InstallPlugin(req dto.AgentPluginInstallReq) error
CheckPlugin(req dto.AgentPluginCheckReq) (*dto.AgentPluginStatus, error)
Expand Down Expand Up @@ -640,7 +640,7 @@ func (a AgentService) DeleteAccount(req dto.AgentAccountDeleteReq) error {
return agentAccountRepo.DeleteByID(req.ID)
}

func (a AgentService) GetSecurityConfig(req dto.AgentSecurityConfigReq) (*dto.AgentSecurityConfig, error) {
func (a AgentService) GetSecurityConfig(req dto.AgentIDReq) (*dto.AgentSecurityConfig, error) {
agent, _, err := a.loadOpenclawAgentAndInstall(req.AgentID)
if err != nil {
return nil, err
Expand Down Expand Up @@ -679,7 +679,7 @@ func (a AgentService) UpdateSecurityConfig(req dto.AgentSecurityConfigUpdateReq)
return appInstallRepo.Save(context.Background(), install)
}

func (a AgentService) GetOtherConfig(req dto.AgentOtherConfigReq) (*dto.AgentOtherConfig, error) {
func (a AgentService) GetOtherConfig(req dto.AgentIDReq) (*dto.AgentOtherConfig, error) {
agent, install, err := a.loadAgentAndInstall(req.AgentID)
if err != nil {
return nil, err
Expand Down
8 changes: 4 additions & 4 deletions agent/app/service/agents_channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (a AgentService) UpdateTelegramConfig(req dto.AgentTelegramConfigUpdateReq)
})
}

func (a AgentService) GetDiscordConfig(req dto.AgentDiscordConfigReq) (*dto.AgentDiscordConfig, error) {
func (a AgentService) GetDiscordConfig(req dto.AgentIDReq) (*dto.AgentDiscordConfig, error) {
_, _, conf, err := a.loadAgentConfig(req.AgentID)
if err != nil {
return nil, err
Expand All @@ -80,7 +80,7 @@ func (a AgentService) UpdateDiscordConfig(req dto.AgentDiscordConfigUpdateReq) e
})
}

func (a AgentService) GetQQBotConfig(req dto.AgentQQBotConfigReq) (*dto.AgentQQBotConfig, error) {
func (a AgentService) GetQQBotConfig(req dto.AgentIDReq) (*dto.AgentQQBotConfig, error) {
_, install, conf, err := a.loadAgentConfig(req.AgentID)
if err != nil {
return nil, err
Expand All @@ -102,7 +102,7 @@ func (a AgentService) UpdateQQBotConfig(req dto.AgentQQBotConfigUpdateReq) error
})
}

func (a AgentService) GetWecomConfig(req dto.AgentWecomConfigReq) (*dto.AgentWecomConfig, error) {
func (a AgentService) GetWecomConfig(req dto.AgentIDReq) (*dto.AgentWecomConfig, error) {
_, install, conf, err := a.loadAgentConfig(req.AgentID)
if err != nil {
return nil, err
Expand All @@ -125,7 +125,7 @@ func (a AgentService) UpdateWecomConfig(req dto.AgentWecomConfigUpdateReq) error
})
}

func (a AgentService) GetDingTalkConfig(req dto.AgentDingTalkConfigReq) (*dto.AgentDingTalkConfig, error) {
func (a AgentService) GetDingTalkConfig(req dto.AgentIDReq) (*dto.AgentDingTalkConfig, error) {
_, install, conf, err := a.loadAgentConfig(req.AgentID)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion agent/app/service/agents_skills.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type skillhubSearchPayload struct {

var clawhubSearchLinePattern = regexp.MustCompile(`^(\S+)\s+(.+?)\s+\(([\d.]+)\)$`)

func (a AgentService) ListSkills(req dto.AgentSkillsReq) ([]dto.AgentSkillItem, error) {
func (a AgentService) ListSkills(req dto.AgentIDReq) ([]dto.AgentSkillItem, error) {
_, install, err := a.loadOpenclawAgentAndInstall(req.AgentID)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion agent/init/migration/migrations/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ SET http_port = https_port,
WHERE version = ?
AND https_port > 0
AND app_id IN (SELECT id FROM apps WHERE key = ?)`,
"2026.3.23",
"2026.3.24",
constant.AppOpenclaw,
).Error
},
Expand Down
23 changes: 23 additions & 0 deletions agent/init/migration/migrations/utils/agent_account_model_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/1Panel-dev/1Panel/agent/app/dto"
"github.com/1Panel-dev/1Panel/agent/app/model"
providercatalog "github.com/1Panel-dev/1Panel/agent/app/provider"
"github.com/1Panel-dev/1Panel/agent/app/service"

"gorm.io/gorm"
Expand Down Expand Up @@ -107,5 +108,27 @@ func buildMigratedAgentAccountModels(tx *gorm.DB, account *legacyAgentAccountMod
}
return nil, err
}
applyLegacyAgentAccountModelDefaults(account.Provider, models)
return models, nil
}

func applyLegacyAgentAccountModelDefaults(provider string, models []dto.AgentAccountModel) {
if provider != "custom" && provider != "ollama" && provider != "vllm" {
return
}
meta, ok := providercatalog.Get(provider)
if !ok {
return
}
for i := range models {
if strings.TrimSpace(models[i].Name) == "" {
models[i].Name = strings.TrimSpace(models[i].ID)
}
if models[i].ContextWindow <= 0 {
models[i].ContextWindow = meta.Default.ContextWindow
}
if models[i].MaxTokens <= 0 {
models[i].MaxTokens = meta.Default.MaxTokens
}
}
}
2 changes: 1 addition & 1 deletion frontend/src/components/log/task/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const config = reactive({
const open = ref(false);
const showTail = ref(true);

const openWithTaskID = (id: string, tail: boolean, operateNode?: string) => {
const openWithTaskID = (id: string, tail?: boolean, operateNode?: string) => {
config.taskID = id;
if (tail === undefined) {
config.tail = true;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/views/ai/agents/agent/components/overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ defineExpose({
color: var(--el-text-color-primary);
}
:deep(.status-count) {
font-size: 18px;
color: var(--el-text-color-primary);
}
:deep(.status-label) {
Expand Down
8 changes: 6 additions & 2 deletions frontend/src/views/ai/agents/agent/config/tabs/skills.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@
@change="(value) => toggleSkill(skill, Boolean(value))"
/>
</div>
<el-tooltip placement="top-start" :show-after="200" popper-class="skill-desc-tooltip">
<el-tooltip
placement="bottom-start"
:show-after="200"
popper-class="skill-desc-tooltip"
>
<template #content>
<div class="skill-desc-tooltip-content">{{ skill.description }}</div>
</template>
Expand Down Expand Up @@ -101,7 +105,7 @@
</div>
<el-tooltip
v-if="skill.description || skill.summary"
placement="top-start"
placement="bottom-start"
:show-after="200"
popper-class="skill-desc-tooltip"
>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/views/ai/agents/agent/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
min-width="200"
:label="$t('commons.table.operate')"
fixed="right"
:ellipsis="4"
:ellipsis="3"
/>
</ComplexTable>
</template>
Expand Down
Loading