mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-15 05:07:30 +08:00
fix: gate node p2p behind explicit config
This commit is contained in:
@@ -142,7 +142,17 @@ func NewAgentLoop(cfg *config.Config, msgBus *bus.MessageBus, provider providers
|
||||
return nodes.Response{OK: false, Code: "unsupported_action", Node: "local", Action: req.Action, Error: "unsupported local simulated action"}
|
||||
}
|
||||
})
|
||||
nodesRouter := &nodes.Router{P2P: &nodes.WebsocketP2PTransport{Manager: nodesManager}, Relay: &nodes.HTTPRelayTransport{Manager: nodesManager}}
|
||||
var nodeP2P nodes.Transport
|
||||
if cfg.Gateway.Nodes.P2P.Enabled {
|
||||
switch strings.ToLower(strings.TrimSpace(cfg.Gateway.Nodes.P2P.Transport)) {
|
||||
case "", "websocket_tunnel":
|
||||
nodeP2P = &nodes.WebsocketP2PTransport{Manager: nodesManager}
|
||||
case "webrtc":
|
||||
// Keep the mode explicit but non-default until a direct data channel is production-ready.
|
||||
nodeP2P = &nodes.WebsocketP2PTransport{Manager: nodesManager}
|
||||
}
|
||||
}
|
||||
nodesRouter := &nodes.Router{P2P: nodeP2P, Relay: &nodes.HTTPRelayTransport{Manager: nodesManager}}
|
||||
toolsRegistry.Register(tools.NewNodesTool(nodesManager, nodesRouter, filepath.Join(workspace, "memory", "nodes-dispatch-audit.jsonl")))
|
||||
|
||||
if cs != nil {
|
||||
|
||||
Reference in New Issue
Block a user