diff --git a/cmd/picoclaw/cmd_gateway.go b/cmd/picoclaw/cmd_gateway.go index 2b9567af5..986480d8c 100644 --- a/cmd/picoclaw/cmd_gateway.go +++ b/cmd/picoclaw/cmd_gateway.go @@ -37,6 +37,7 @@ func gatewayCmd() { // Check for --debug and --stats flags args := os.Args[2:] enableStats := false + orchestrationEnabled := false for _, arg := range args { if arg == "--debug" || arg == "-d" { logger.SetLevel(logger.DEBUG) @@ -45,6 +46,9 @@ func gatewayCmd() { if arg == "--stats" { enableStats = true } + if arg == "--orchestration" { + orchestrationEnabled = true + } } cfg, err := loadConfig() @@ -58,6 +62,10 @@ func gatewayCmd() { fmt.Printf("Error creating provider: %v\n", err) os.Exit(1) } + if orchestrationEnabled { + cfg.Agents.Defaults.Orchestration = true + } + // Use the resolved model ID from provider creation if modelID != "" { cfg.Agents.Defaults.Model = modelID diff --git a/pkg/agent/loop.go b/pkg/agent/loop.go index 4649e71eb..00033edbe 100644 --- a/pkg/agent/loop.go +++ b/pkg/agent/loop.go @@ -137,6 +137,8 @@ func NewAgentLoop(cfg *config.Config, msgBus *bus.MessageBus, provider providers } // Determine if orchestration broadcaster is needed (any agent has subagents enabled). + // Note: instance.go maps defaults.Orchestration → Subagents.Enabled, so --orchestration + // is automatically reflected here. var orchBroadcaster *orch.Broadcaster var orchReporter orch.AgentReporter = orch.Noop for _, id := range registry.ListAgentIDs() {