feat webui: config hot-reload + chat/media upload endpoints

This commit is contained in:
DBT
2026-02-25 11:54:08 +00:00
parent f04a6939b3
commit 175a96fb2b
2 changed files with 201 additions and 5 deletions

View File

@@ -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 {