Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/docker_agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, pro
},
})
}

// protoToContents converts history to Gemini conversation format.
func protoToContents(inputs []*proto.Message) []*genai.Content {
var contents []*genai.Content
Expand Down
4 changes: 2 additions & 2 deletions examples/remote_agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, pro

if err := stream.Send(&proto.AgentMessage{
ConversationId: incoming.ConversationId,
ExecId: incoming.ExecId,
ExecId: incoming.ExecId,
Type: &proto.AgentMessage_Outputs{
Outputs: &proto.AgentOutputs{
Messages: []*proto.Message{responseMsg},
Expand All @@ -94,7 +94,7 @@ func (s *server) Connect(stream grpc.BidiStreamingServer[proto.AgentMessage, pro
// Send AgentEnd to signal end of outputs.
if err := stream.Send(&proto.AgentMessage{
ConversationId: incoming.ConversationId,
ExecId: incoming.ExecId,
ExecId: incoming.ExecId,
Type: &proto.AgentMessage_End{
End: &proto.AgentEnd{},
},
Expand Down
4 changes: 1 addition & 3 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func New(ctx context.Context, cfg Config) (*Controller, error) {
return nil, fmt.Errorf("failed to create event log: %w", err)
}



return &Controller{
registry: registry,
eventLog: eventLog,
Expand Down Expand Up @@ -172,7 +170,7 @@ func (d *Controller) Exec(ctx context.Context, req *proto.ExecRequest, handler E
if err != nil {
return fmt.Errorf("failed to create planner: %w", err)
}

registry := maps.Clone(d.registry.Map())
registry[plannerAgentID] = planner

Expand Down
7 changes: 3 additions & 4 deletions internal/gemini/gemini_planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
)

type contextKey string

const disallowConfirmationsKey contextKey = "disallowConfirmations"

// AgentRegistry defines the interface needed by the planner to discover agents.
Expand Down Expand Up @@ -189,7 +190,7 @@ func (p *geminiPlannerAgent) loop(ctx context.Context, conversationID string, st
if state == proto.State_STATE_PENDING {
return nil
}

}
}

Expand Down Expand Up @@ -352,7 +353,7 @@ func (p *geminiPlannerAgent) handleSubagentCall(ctx context.Context, conversatio
}

subagentStart := &proto.AgentStart{
AgentId: mappedName,
AgentId: mappedName,
Messages: []*proto.Message{
{
Role: "user",
Expand Down Expand Up @@ -415,7 +416,6 @@ func (p *geminiPlannerAgent) handleSubagentCall(ctx context.Context, conversatio
})
}


var resultText strings.Builder
for _, msg := range subagentOutputs {
if msg.Content != nil {
Expand Down Expand Up @@ -455,7 +455,6 @@ func (p *geminiPlannerAgent) handleSubagentCall(ctx context.Context, conversatio
})
}


func (p *geminiPlannerAgent) handleConfirmationAnswer(inputs []*proto.Message) (*genai.FunctionCall, bool) {
var conf *proto.ConfirmationContent
var approved bool
Expand Down
3 changes: 1 addition & 2 deletions internal/gemini/gemini_planner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func TestAgentsToTools_Parameters(t *testing.T) {
if len(required) != 2 {
t.Errorf("expected 2 required properties, got %d", len(required))
}

foundHistory := false
foundPrompt := false
for _, r := range required {
Expand Down Expand Up @@ -466,4 +466,3 @@ func TestNewGeminiPlannerAgent_NoSkillsPrompt(t *testing.T) {
t.Errorf("expected system prompt to not contain '<available_skills>', got: %s", prompt)
}
}

5 changes: 2 additions & 3 deletions internal/gemini/gemini_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ func TestNewSkillsTool_WithSkills(t *testing.T) {
if err != nil {
t.Fatal(err)
}

skillContent := `---
name: test-skill
description: A test skill
---
Instructions go here.`

err = os.WriteFile(filepath.Join(skillDir, "SKILL.md"), []byte(skillContent), 0644)
if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -113,4 +113,3 @@ func TestNewSkillsTool_NoDir(t *testing.T) {
t.Errorf("Expected NoopTool, got %T", tool)
}
}

2 changes: 1 addition & 1 deletion internal/server/server_ate.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func suspendActor(actorID string) {

log.Printf("Automatically suspending actor %s in 50 milliseconds...", actorID)
time.Sleep(50 * time.Millisecond)

suspendCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

Expand Down
Loading