Skip to content

armgit / ax

Public Imported from GitHub
0

Agent Executor (AX) is Google's open agentic orchestration runtime

Go

Consistently name controller controller

Jaana Dogan09b11a498b6e
diff --git a/agent/agent.go b/agent/agent.go
index 14ce2e4..97c6aed 100644
--- a/agent/agent.go
+++ b/agent/agent.go
@@ -13,7 +13,7 @@
// limitations under the License.
// Package agent provides interfaces and implementations for local and remote agents.
-// Agents process content through callback handlers and can be registered with the dispatcher.
+// Agents process content through callback handlers and can be registered with the controller.
package agent
import (
diff --git a/agent/local.go b/agent/local.go
index e633a79..c9af343 100644
--- a/agent/local.go
+++ b/agent/local.go
@@ -22,7 +22,7 @@ import (
)
// LocalAgent wraps a local (in-process) agent implementation.
-// It implements the Agent interface for agents running in the same process as the dispatcher.
+// It implements the Agent interface for agents running in the same process as the controller.
type LocalAgent struct {
processFunc func(ctx context.Context, sessionID string, inputs []*proto.Content, handler OutputHandler) error
healthCheckFunc func(ctx context.Context) error
diff --git a/examples/remote_agent/main.go b/examples/remote_agent/main.go
index bf5b922..f745e43 100644
--- a/examples/remote_agent/main.go
+++ b/examples/remote_agent/main.go
@@ -35,23 +35,23 @@ type server struct {
}
// Process implements bidirectional streaming for content processing.
-// This RPC is called by the gar dispatcher when a session triggers this agent.
+// This RPC is called by the gar controller when a session triggers this agent.
func (s *server) Process(stream proto.AgentService_ProcessServer) error {
- log.Println("Process stream started - gar dispatcher connected")
+ log.Println("Process stream started - gar controller connected")
for {
- // Receive input content from gar dispatcher
+ // Receive input content from gar controller
content, err := stream.Recv()
if err == io.EOF {
- log.Println("Process stream closed by gar dispatcher")
+ log.Println("Process stream closed by gar controller")
return nil
}
if err != nil {
- log.Printf("Error receiving from dispatcher: %v", err)
+ log.Printf("Error receiving from controller: %v", err)
return err
}
- log.Printf("Received from dispatcher: role=%s, type=%s, data=%s",
+ log.Printf("Received from controller: role=%s, type=%s, data=%s",
content.Role, content.Type, content.Data)
// Process the content (simple uppercase echo)
@@ -62,13 +62,13 @@ func (s *server) Process(stream proto.AgentService_ProcessServer) error {
Data: fmt.Sprintf("Remote Echo: %s", strings.ToUpper(content.Data)),
}
- // Send response back to gar dispatcher
+ // Send response back to gar controller
if err := stream.Send(response); err != nil {
- log.Printf("Error sending to dispatcher: %v", err)
+ log.Printf("Error sending to controller: %v", err)
return err
}
- log.Printf("Sent to dispatcher: %s", response.Data)
+ log.Printf("Sent to controller: %s", response.Data)
}
}
diff --git a/internal/server/server.go b/internal/server/server.go
index 03091a2..f9d070b 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -100,7 +100,7 @@ func (s *Server) GetSession(ctx context.Context, req *proto.GetSessionRequest) (
}, nil
}
-// RegisterAgent registers a new remote agent with the dispatcher.
+// RegisterAgent registers a new remote agent with the controller.
func (s *Server) RegisterAgent(ctx context.Context, req *proto.RegisterAgentRequest) (*proto.RegisterAgentResponse, error) {
if req.AgentId == "" {
return nil, fmt.Errorf("agent_id is required")
@@ -127,7 +127,7 @@ func (s *Server) RegisterAgent(ctx context.Context, req *proto.RegisterAgentRequ
return &proto.RegisterAgentResponse{}, nil
}
-// UnregisterAgent removes a remote agent from the dispatcher.
+// UnregisterAgent removes a remote agent from the controller.
// Local agents cannot be unregistered via this API.
func (s *Server) UnregisterAgent(ctx context.Context, req *proto.UnregisterAgentRequest) (*proto.UnregisterAgentResponse, error) {
if req.AgentId == "" {
diff --git a/proto/gar.proto b/proto/gar.proto
index 4fc5f37..0823f82 100644
--- a/proto/gar.proto
+++ b/proto/gar.proto
@@ -42,7 +42,7 @@ message HealthCheckResponse {
// AgentService defines the gRPC service for agent communication
service AgentService {
- // Process handles bidirectional streaming of content between dispatcher and agent
+ // Process handles bidirectional streaming of content between controller and agent
rpc Process(stream Content) returns (stream Content);
// HealthCheck checks if the agent is healthy and responsive
diff --git a/proto/gar_grpc.pb.go b/proto/gar_grpc.pb.go
index f65ef31..e5e4fba 100644
--- a/proto/gar_grpc.pb.go
+++ b/proto/gar_grpc.pb.go
@@ -22,6 +22,7 @@ package proto
import (
context "context"
+
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
@@ -43,7 +44,7 @@ const (
//
// AgentService defines the gRPC service for agent communication
type AgentServiceClient interface {
- // Process handles bidirectional streaming of content between dispatcher and agent
+ // Process handles bidirectional streaming of content between controller and agent
Process(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Content, Content], error)
// HealthCheck checks if the agent is healthy and responsive
HealthCheck(ctx context.Context, in *HealthCheckRequest, opts ...grpc.CallOption) (*HealthCheckResponse, error)
@@ -86,7 +87,7 @@ func (c *agentServiceClient) HealthCheck(ctx context.Context, in *HealthCheckReq
//
// AgentService defines the gRPC service for agent communication
type AgentServiceServer interface {
- // Process handles bidirectional streaming of content between dispatcher and agent
+ // Process handles bidirectional streaming of content between controller and agent
Process(grpc.BidiStreamingServer[Content, Content]) error
// HealthCheck checks if the agent is healthy and responsive
HealthCheck(context.Context, *HealthCheckRequest) (*HealthCheckResponse, error)