mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-27 16:47:29 +08:00
feat webui: config hot-reload + chat/media upload endpoints
This commit is contained in:
@@ -178,6 +178,16 @@ func gatewayCmd() {
|
||||
}
|
||||
|
||||
registryServer := nodes.NewRegistryServer(cfg.Gateway.Host, cfg.Gateway.Port, cfg.Gateway.Token, nodes.DefaultManager())
|
||||
registryServer.SetConfigPath(getConfigPath())
|
||||
registryServer.SetChatHandler(func(cctx context.Context, sessionKey, content string) (string, error) {
|
||||
if strings.TrimSpace(content) == "" {
|
||||
return "", nil
|
||||
}
|
||||
return agentLoop.ProcessDirect(cctx, content, sessionKey)
|
||||
})
|
||||
registryServer.SetConfigAfterHook(func() {
|
||||
_ = syscall.Kill(os.Getpid(), syscall.SIGHUP)
|
||||
})
|
||||
if err := registryServer.Start(ctx); err != nil {
|
||||
fmt.Printf("Error starting node registry server: %v\n", err)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user