diff --git a/agent/app/service/agents.go b/agent/app/service/agents.go index 0d0dbc24a935..426cc0567eb2 100644 --- a/agent/app/service/agents.go +++ b/agent/app/service/agents.go @@ -493,6 +493,7 @@ func (a AgentService) UpdateFeishuConfig(req dto.AgentFeishuConfigUpdateReq) err AppID: req.AppID, AppSecret: req.AppSecret, }) + setFeishuPluginEnabled(conf, req.Enabled) if err := writeOpenclawConfigRaw(agent.ConfigPath, conf); err != nil { return err } @@ -610,6 +611,13 @@ func setFeishuConfig(conf map[string]interface{}, config dto.AgentFeishuConfig) channels["feishu"] = feishu } +func setFeishuPluginEnabled(conf map[string]interface{}, enabled bool) { + plugins := ensureChildMap(conf, "plugins") + entries := ensureChildMap(plugins, "entries") + feishu := ensureChildMap(entries, "feishu") + feishu["enabled"] = enabled +} + func (a AgentService) syncAgentsByAccount(account *model.AgentAccount) error { agents, err := agentRepo.List(repo.WithByAccountID(account.ID)) if err != nil {