Skip to content

Commit 5497e5d

Browse files
kevinelliottclaude
andcommitted
Include agent prompts when streaming to bridge
Agent Details: - Added GetPrompt() method to Agent interface - Implemented in BaseAgent to return Config.Prompt - Updated orchestrator to include prompt when building AgentParticipant list Bridge Streaming: - conversation.started events now include each agent's system prompt - Provides full agent context to AgentPipe Web for better conversation understanding Testing: - Updated MockAgent in orchestrator tests to implement GetPrompt() - Updated mockAgent in TUI tests to implement GetPrompt() - All tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 32cf74a commit 5497e5d

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

pkg/agent/agent.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ type Agent interface {
102102
HealthCheck(ctx context.Context) error
103103
// GetCLIVersion returns the version of the agent's CLI tool
104104
GetCLIVersion() string
105+
// GetPrompt returns the system prompt for the agent
106+
GetPrompt() string
105107
}
106108

107109
// BaseAgent provides a default implementation of common Agent interface methods.
@@ -159,6 +161,11 @@ func (b *BaseAgent) GetRateLimitBurst() int {
159161
return 1 // Default burst size
160162
}
161163

164+
// GetPrompt returns the system prompt for the agent.
165+
func (b *BaseAgent) GetPrompt() string {
166+
return b.Config.Prompt
167+
}
168+
162169
// Announce returns the agent's announcement message.
163170
// If a custom announcement is set, it is returned; otherwise,
164171
// a default message is generated using the agent's name.

pkg/orchestrator/orchestrator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ func (o *Orchestrator) Start(ctx context.Context) error {
313313
AgentType: a.GetType(),
314314
Model: a.GetModel(),
315315
Name: a.GetName(),
316+
Prompt: a.GetPrompt(),
316317
CLIVersion: a.GetCLIVersion(),
317318
})
318319
}

pkg/orchestrator/orchestrator_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ func (m *MockAgent) GetRateLimitBurst() int { return m.rateLimitBurst }
4040
func (m *MockAgent) IsAvailable() bool { return m.available }
4141
func (m *MockAgent) Announce() string { return m.name + " has joined" }
4242
func (m *MockAgent) GetCLIVersion() string { return "1.0.0" }
43+
func (m *MockAgent) GetPrompt() string { return "You are a helpful assistant" }
4344
func (m *MockAgent) Initialize(config agent.AgentConfig) error {
4445
m.id = config.ID
4546
m.name = config.Name

pkg/tui/tui_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,6 +802,7 @@ func (m *mockAgent) GetModel() string { return "mock-mo
802802
func (m *mockAgent) GetRateLimit() float64 { return 0 }
803803
func (m *mockAgent) GetRateLimitBurst() int { return 0 }
804804
func (m *mockAgent) GetCLIVersion() string { return "1.0.0" }
805+
func (m *mockAgent) GetPrompt() string { return "You are a helpful assistant" }
805806
func (m *mockAgent) Initialize(config agent.AgentConfig) error { return nil }
806807
func (m *mockAgent) SendMessage(ctx context.Context, messages []agent.Message) (string, error) {
807808
return "mock response", nil

0 commit comments

Comments
 (0)