Fix Docker Swarm discovery network name mismatch

- Changed NetworkName from 'chorus_default' to 'chorus_net'
- This matches the actual network 'CHORUS_chorus_net' (service prefix added automatically)
- Fixes discovered_count:0 issue - now successfully discovering all 25 agents
- Updated IMPLEMENTATION-SUMMARY with deployment status

Result: All 25 CHORUS agents now discovered successfully via Docker Swarm API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Code
2025-10-10 10:35:25 +11:00
parent 2826b28645
commit 9aeaa433fc
36 changed files with 4721 additions and 2213 deletions

View File

@@ -216,9 +216,17 @@ func (cc *CouncilComposer) storeCouncilComposition(ctx context.Context, composit
INSERT INTO councils (id, project_name, repository, project_brief, status, created_at, task_id, issue_id, external_url, metadata)
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)
`
metadataJSON, _ := json.Marshal(request.Metadata)
// Convert zero UUID to nil for task_id
var taskID interface{}
if request.TaskID == uuid.Nil {
taskID = nil
} else {
taskID = request.TaskID
}
_, err := cc.db.Exec(ctx, councilQuery,
composition.CouncilID,
composition.ProjectName,
@@ -226,12 +234,12 @@ func (cc *CouncilComposer) storeCouncilComposition(ctx context.Context, composit
request.ProjectBrief,
composition.Status,
composition.CreatedAt,
request.TaskID,
taskID,
request.IssueID,
request.ExternalURL,
metadataJSON,
)
if err != nil {
return fmt.Errorf("failed to store council metadata: %w", err)
}
@@ -303,26 +311,31 @@ func (cc *CouncilComposer) GetCouncilComposition(ctx context.Context, councilID
// Get all agents for this council
agentQuery := `
SELECT agent_id, role_name, agent_name, required, deployed, status, deployed_at
FROM council_agents
SELECT agent_id, role_name, agent_name, required, deployed, status, deployed_at,
persona_status, persona_loaded_at, endpoint_url, persona_ack_payload
FROM council_agents
WHERE council_id = $1
ORDER BY required DESC, role_name ASC
`
rows, err := cc.db.Query(ctx, agentQuery, councilID)
if err != nil {
return nil, fmt.Errorf("failed to query council agents: %w", err)
}
defer rows.Close()
// Separate core and optional agents
var coreAgents []CouncilAgent
var optionalAgents []CouncilAgent
for rows.Next() {
var agent CouncilAgent
var deployedAt *time.Time
var personaStatus *string
var personaLoadedAt *time.Time
var endpointURL *string
var personaAckPayload []byte
err := rows.Scan(
&agent.AgentID,
&agent.RoleName,
@@ -331,13 +344,28 @@ func (cc *CouncilComposer) GetCouncilComposition(ctx context.Context, councilID
&agent.Deployed,
&agent.Status,
&deployedAt,
&personaStatus,
&personaLoadedAt,
&endpointURL,
&personaAckPayload,
)
if err != nil {
return nil, fmt.Errorf("failed to scan agent row: %w", err)
}
agent.DeployedAt = deployedAt
agent.PersonaStatus = personaStatus
agent.PersonaLoadedAt = personaLoadedAt
agent.EndpointURL = endpointURL
// Parse JSON payload if present
if personaAckPayload != nil {
var payload map[string]interface{}
if err := json.Unmarshal(personaAckPayload, &payload); err == nil {
agent.PersonaAckPayload = payload
}
}
if agent.Required {
coreAgents = append(coreAgents, agent)