Skip to content

Commit dc5115d

Browse files
kevinelliottclaude
andcommitted
Rename 'agents' field to 'participants' in bridge events
Field Name Update: - Changed ConversationStartedData.Agents to Participants - Updated JSON tag from "agents" to "participants" - Matches backend API schema expectations Context: - Backend expects 'participants' field, not 'agents' - This ensures full agent details (name, model, prompt, cli_version) are properly stored and returned by the backend - Previously backend was only showing participant names as strings Testing: - Updated all test cases to use 'participants' field - Updated test assertions to check "participants" instead of "agents" - All tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5497e5d commit dc5115d

4 files changed

Lines changed: 13 additions & 13 deletions

File tree

internal/bridge/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func TestSendEvent_Success(t *testing.T) {
111111
ConversationID: "test-123",
112112
Mode: "round-robin",
113113
InitialPrompt: "Test",
114-
Agents: []AgentParticipant{},
114+
Participants: []AgentParticipant{},
115115
SystemInfo: SystemInfo{},
116116
},
117117
}

internal/bridge/emitter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func (e *Emitter) EmitConversationStarted(
4444
Mode: mode,
4545
InitialPrompt: initialPrompt,
4646
MaxTurns: maxTurns,
47-
Agents: agents,
47+
Participants: agents,
4848
SystemInfo: e.systemInfo,
4949
},
5050
}

internal/bridge/events.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ type ConversationStartedData struct {
5151
Mode string `json:"mode"`
5252
InitialPrompt string `json:"initial_prompt"`
5353
MaxTurns int `json:"max_turns,omitempty"`
54-
Agents []AgentParticipant `json:"agents"`
54+
Participants []AgentParticipant `json:"participants"`
5555
SystemInfo SystemInfo `json:"system_info"`
5656
}
5757

internal/bridge/events_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestEventJSONSerialization(t *testing.T) {
3636
Mode: "round-robin",
3737
InitialPrompt: "Hello agents",
3838
MaxTurns: 10,
39-
Agents: agents,
39+
Participants: agents,
4040
SystemInfo: sysInfo,
4141
},
4242
}
@@ -82,19 +82,19 @@ func TestEventJSONSerialization(t *testing.T) {
8282
}
8383
}
8484

85-
// Verify agents array is present and has cli_version
86-
agentsArray, ok := dataMap["agents"].([]interface{})
87-
if !ok || len(agentsArray) == 0 {
88-
t.Fatal("Expected agents to be a non-empty array")
85+
// Verify participants array is present and has cli_version
86+
participantsArray, ok := dataMap["participants"].([]interface{})
87+
if !ok || len(participantsArray) == 0 {
88+
t.Fatal("Expected participants to be a non-empty array")
8989
}
9090

91-
agentMap, ok := agentsArray[0].(map[string]interface{})
91+
participantMap, ok := participantsArray[0].(map[string]interface{})
9292
if !ok {
93-
t.Fatal("Expected first agent to be an object")
93+
t.Fatal("Expected first participant to be an object")
9494
}
9595

96-
if agentMap["cli_version"] != "1.2.0" {
97-
t.Errorf("Expected cli_version=1.2.0, got %v", agentMap["cli_version"])
96+
if participantMap["cli_version"] != "1.2.0" {
97+
t.Errorf("Expected cli_version=1.2.0, got %v", participantMap["cli_version"])
9898
}
9999
}
100100

@@ -292,7 +292,7 @@ func TestTimestampFormat(t *testing.T) {
292292
ConversationID: "test",
293293
Mode: "round-robin",
294294
InitialPrompt: "test",
295-
Agents: []AgentParticipant{},
295+
Participants: []AgentParticipant{},
296296
SystemInfo: SystemInfo{},
297297
},
298298
}

0 commit comments

Comments
 (0)