fix: --orchestration flag not applied in gateway command
cmd_gateway.go parsed --debug and --stats but not --orchestration, so cfg.Agents.Defaults.Orchestration was never set to true. As a result GetOrchBroadcaster() returned nil, SetOrchBroadcaster() was never called, and the /miniapp/api/orchestration/ws endpoint always returned 503 → "Disconnected" in the Orch tab. Also restored loop.go comment to clarify that instance.go already maps defaults.Orchestration → Subagents.Enabled before the loop runs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e40efb7dd7
commit
603b49e513
2 changed files with 10 additions and 0 deletions
|
|
@ -37,6 +37,7 @@ func gatewayCmd() {
|
||||||
// Check for --debug and --stats flags
|
// Check for --debug and --stats flags
|
||||||
args := os.Args[2:]
|
args := os.Args[2:]
|
||||||
enableStats := false
|
enableStats := false
|
||||||
|
orchestrationEnabled := false
|
||||||
for _, arg := range args {
|
for _, arg := range args {
|
||||||
if arg == "--debug" || arg == "-d" {
|
if arg == "--debug" || arg == "-d" {
|
||||||
logger.SetLevel(logger.DEBUG)
|
logger.SetLevel(logger.DEBUG)
|
||||||
|
|
@ -45,6 +46,9 @@ func gatewayCmd() {
|
||||||
if arg == "--stats" {
|
if arg == "--stats" {
|
||||||
enableStats = true
|
enableStats = true
|
||||||
}
|
}
|
||||||
|
if arg == "--orchestration" {
|
||||||
|
orchestrationEnabled = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg, err := loadConfig()
|
cfg, err := loadConfig()
|
||||||
|
|
@ -58,6 +62,10 @@ func gatewayCmd() {
|
||||||
fmt.Printf("Error creating provider: %v\n", err)
|
fmt.Printf("Error creating provider: %v\n", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
if orchestrationEnabled {
|
||||||
|
cfg.Agents.Defaults.Orchestration = true
|
||||||
|
}
|
||||||
|
|
||||||
// Use the resolved model ID from provider creation
|
// Use the resolved model ID from provider creation
|
||||||
if modelID != "" {
|
if modelID != "" {
|
||||||
cfg.Agents.Defaults.Model = modelID
|
cfg.Agents.Defaults.Model = modelID
|
||||||
|
|
|
||||||
|
|
@ -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).
|
// 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 orchBroadcaster *orch.Broadcaster
|
||||||
var orchReporter orch.AgentReporter = orch.Noop
|
var orchReporter orch.AgentReporter = orch.Noop
|
||||||
for _, id := range registry.ListAgentIDs() {
|
for _, id := range registry.ListAgentIDs() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue