(req dto.AgentIDReq)
| 1318 | } |
| 1319 | |
| 1320 | func (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 | |
| 1348 | func (a AgentService) UpdateOtherConfig(req dto.AgentOtherConfigUpdateReq) error { |
| 1349 | agent, install, err := a.loadAgentAndInstall(req.AgentID) |
nothing calls this directly
no test coverage detected