fix: fix issue with openclaw discord config error (#12456)

This commit is contained in:
CityFun
2026-04-09 17:39:01 +08:00
committed by GitHub
parent 3f14f8f30e
commit 16d5c00b9a
4 changed files with 12 additions and 15 deletions
+4 -3
View File
@@ -700,9 +700,10 @@ func setDiscordConfig(conf map[string]interface{}, config dto.AgentDiscordConfig
accounts := make(map[string]interface{}, len(config.Bots))
for _, bot := range config.Bots {
accounts[bot.AccountID] = map[string]interface{}{
"enabled": bot.Enabled,
"name": bot.Name,
"token": bot.Token,
"enabled": bot.Enabled,
"name": bot.Name,
"token": bot.Token,
"groupPolicy": config.GroupPolicy,
}
}
discord["accounts"] = accounts
+5 -5
View File
@@ -48,7 +48,7 @@ func (a AgentService) ListSkills(req dto.AgentIDReq) ([]dto.AgentSkillItem, erro
if err := ensureContainerRunning(install.ContainerName); err != nil {
return nil, err
}
output, err := runDockerExecWithStdout(30*time.Second, install.ContainerName, "sh", "-c", "openclaw skills list --json 2>&1")
output, err := runDockerExecWithStdout(60*time.Second, install.ContainerName, "sh", "-c", "openclaw skills list --json 2>&1")
if err != nil {
return nil, err
}
@@ -114,7 +114,7 @@ func (a AgentService) InstallSkill(req dto.AgentSkillInstallReq) error {
return err
}
installTask.AddSubTask("Install OpenClaw skill", func(t *task.Task) error {
mgr := cmd.NewCommandMgr(cmd.WithTask(*t), cmd.WithContext(t.TaskCtx), cmd.WithTimeout(10*time.Minute))
mgr := cmd.NewCommandMgr(cmd.WithTask(*t), cmd.WithContext(t.TaskCtx), cmd.WithTimeout(20*time.Minute))
return mgr.Run("docker", "exec", install.ContainerName, "sh", "-c", buildOpenclawSkillInstallCommand(req.Source, req.Slug))
}, nil)
go func() {
@@ -153,10 +153,10 @@ func parseOpenclawSkillsList(output string) ([]dto.AgentSkillItem, error) {
func loadOpenclawSkillSearchOutput(containerName, source, keyword string) (string, error) {
switch source {
case "skillhub":
return runDockerExecWithStdout(30*time.Second, containerName, "skillhub", "search", keyword, "--json")
return runDockerExecWithStdout(60*time.Second, containerName, "skillhub", "search", keyword, "--json")
default:
return runDockerExecWithStdout(
30*time.Second,
60*time.Second,
containerName,
"sh",
"-c",
@@ -238,7 +238,7 @@ func resolveClawhubRegistry(source string) string {
}
func getOpenclawSkillKey(containerName, name string) (string, error) {
output, err := runDockerExecWithStdout(30*time.Second, containerName, "sh", "-c", fmt.Sprintf("openclaw skills info %q --json 2>&1", name))
output, err := runDockerExecWithStdout(60*time.Second, containerName, "sh", "-c", fmt.Sprintf("openclaw skills info %q --json 2>&1", name))
if err != nil {
return "", err
}
+1 -5
View File
@@ -1617,11 +1617,7 @@ func generateToken() string {
}
func asyncReportAIProviderInstall(provider string) {
if global.CONF.Base.Mode != "stable" {
return
}
provider = provider
if provider == "" {
if global.CONF.Base.Mode != "stable" || provider == "" {
return
}
go func(provider string) {
+2 -2
View File
@@ -299,11 +299,11 @@ export const updateAgentConfigFile = (req: AI.AgentConfigFileUpdateReq) => {
};
export const listAgentSkills = (req: AI.AgentSkillsReq) => {
return http.post<AI.AgentSkillItem[]>(`/ai/agents/skills/list`, req);
return http.post<AI.AgentSkillItem[]>(`/ai/agents/skills/list`, req, TimeoutEnum.T_60S);
};
export const searchAgentSkills = (req: AI.AgentSkillSearchReq) => {
return http.post<AI.AgentSkillSearchItem[]>(`/ai/agents/skills/search`, req);
return http.post<AI.AgentSkillSearchItem[]>(`/ai/agents/skills/search`, req, TimeoutEnum.T_60S);
};
export const updateAgentSkill = (req: AI.AgentSkillUpdateReq) => {