MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / mutateAgentConfig

Method mutateAgentConfig

agent/app/service/agents.go:1504–1513  ·  view source on GitHub ↗
(agentID uint, fn func(agent *model.Agent, install *model.AppInstall, conf map[string]interface{}) error)

Source from the content-addressed store, hash-verified

1502}
1503
1504func (a AgentService) mutateAgentConfig(agentID uint, fn func(agent *model.Agent, install *model.AppInstall, conf map[string]interface{}) error) error {
1505 agent, install, conf, err := a.loadAgentConfig(agentID)
1506 if err != nil {
1507 return err
1508 }
1509 if err := fn(agent, install, conf); err != nil {
1510 return err
1511 }
1512 return writeOpenclawConfigRaw(agent.ConfigPath, conf)
1513}
1514
1515func (a AgentService) syncAgentsByAccount(account *model.AgentAccount) error {
1516 agents, err := agentRepo.List(repo.WithByAccountID(account.ID))

Callers 6

UpdateFeishuConfigMethod · 0.95
UpdateTelegramConfigMethod · 0.95
UpdateDiscordConfigMethod · 0.95
UpdateQQBotConfigMethod · 0.95
UpdateWecomConfigMethod · 0.95
UpdateDingTalkConfigMethod · 0.95

Calls 2

loadAgentConfigMethod · 0.95
writeOpenclawConfigRawFunction · 0.85

Tested by

no test coverage detected