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

Method GetOtherConfig

agent/app/service/agents.go:1320–1346  ·  view source on GitHub ↗
(req dto.AgentIDReq)

Source from the content-addressed store, hash-verified

1318}
1319
1320func (a AgentService) GetOtherConfig(req dto.AgentIDReq) (*dto.AgentOtherConfig, error) {
1321 agent, install, err := a.loadAgentAndInstall(req.AgentID)
1322 if err != nil {
1323 return nil, err
1324 }
1325 if agent.AgentType == constant.AppHermesAgent {
1326 cfg, err := readHermesConfig(agent.ConfigPath)
1327 if err != nil {
1328 return nil, err
1329 }
1330 return &dto.AgentOtherConfig{
1331 UserTimezone: cfg.Timezone,
1332 BrowserEnabled: true,
1333 NPMRegistry: "https://registry.npmjs.org/",
1334 }, nil
1335 }
1336 conf, err := readOpenclawConfig(agent.ConfigPath)
1337 if err != nil {
1338 return nil, err
1339 }
1340 result := extractOtherConfig(conf)
1341 npmRegistry, err := getOpenclawNPMRegistry(install.ContainerName)
1342 if err == nil {
1343 result.NPMRegistry = npmRegistry
1344 }
1345 return &result, nil
1346}
1347
1348func (a AgentService) UpdateOtherConfig(req dto.AgentOtherConfigUpdateReq) error {
1349 agent, install, err := a.loadAgentAndInstall(req.AgentID)

Callers

nothing calls this directly

Calls 5

loadAgentAndInstallMethod · 0.95
readHermesConfigFunction · 0.85
readOpenclawConfigFunction · 0.85
extractOtherConfigFunction · 0.85
getOpenclawNPMRegistryFunction · 0.85

Tested by

no test coverage detected