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

Method loadAgentAndInstall

agent/app/service/agents.go:1455–1468  ·  view source on GitHub ↗
(agentID uint)

Source from the content-addressed store, hash-verified

1453}
1454
1455func (a AgentService) loadAgentAndInstall(agentID uint) (*model.Agent, *model.AppInstall, error) {
1456 agent, err := agentRepo.GetFirst(repo.WithByID(agentID))
1457 if err != nil {
1458 return nil, nil, err
1459 }
1460 if agent.AppInstallID == 0 {
1461 return nil, nil, buserr.New("ErrRecordNotFound")
1462 }
1463 install, err := appInstallRepo.GetFirst(repo.WithByID(agent.AppInstallID))
1464 if err != nil {
1465 return nil, nil, err
1466 }
1467 return agent, &install, nil
1468}
1469
1470func (a AgentService) loadOpenclawAgentAndInstall(agentID uint) (*model.Agent, *model.AppInstall, error) {
1471 agent, install, err := a.loadAgentAndInstall(agentID)

Callers 15

GetHermesChatSessionsMethod · 0.95
GetOtherConfigMethod · 0.95
UpdateOtherConfigMethod · 0.95
GetConfigFileMethod · 0.95
UpdateConfigFileMethod · 0.95
loadAgentConfigMethod · 0.95
CreateRoleMethod · 0.95
ListSkillsMethod · 0.95
SearchSkillsMethod · 0.95

Calls 2

GetFirstMethod · 0.65
WithByIDMethod · 0.65

Tested by

no test coverage detected