Skip to content

armgit / ax

Public Imported from GitHub
0

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

Go

Remove agent_id from LifecycleEvent

JBD5c4fa994a939
diff --git a/README.md b/README.md
index 7cb8a6e..704a579 100644
--- a/README.md
+++ b/README.md
@@ -262,7 +262,6 @@ lifecycleFunc := func(ctx context.Context, handler agent.LifecycleHandler) error
// Send lifecycle events via handler callback
return handler(&proto.LifecycleEvent{
EventType: "PROGRESS",
- AgentId: "my-agent",
Timestamp: timestamppb.Now(),
Metadata: map[string]string{"status": "processing"},
})
diff --git a/examples/local_agent/main.go b/examples/local_agent/main.go
index e98ecae..467f029 100644
--- a/examples/local_agent/main.go
+++ b/examples/local_agent/main.go
@@ -100,7 +100,6 @@ func createEchoAgent(id string) (*agent.LocalAgent, error) {
// Send initial PROGRESS event
if err := handler(&proto.LifecycleEvent{
EventType: "PROGRESS",
- AgentId: id,
Timestamp: timestamppb.Now(),
Metadata: map[string]string{
"status": "started",
@@ -118,7 +117,6 @@ func createEchoAgent(id string) (*agent.LocalAgent, error) {
case <-ticker.C:
if err := handler(&proto.LifecycleEvent{
EventType: "PROGRESS",
- AgentId: id,
Timestamp: timestamppb.Now(),
Metadata: map[string]string{
"status": "processing",
diff --git a/examples/remote_agent/main.go b/examples/remote_agent/main.go
index 1a5ee7a..b297a1a 100644
--- a/examples/remote_agent/main.go
+++ b/examples/remote_agent/main.go
@@ -74,7 +74,6 @@ func (s *server) StreamLifecycle(stream proto.AgentService_StreamLifecycleServer
// Send initial PROGRESS event
if err := stream.Send(&proto.LifecycleEvent{
EventType: "PROGRESS",
- AgentId: s.agentID,
Timestamp: timestamppb.Now(),
Metadata: map[string]string{
"status": "started",
@@ -92,7 +91,6 @@ func (s *server) StreamLifecycle(stream proto.AgentService_StreamLifecycleServer
case <-ticker.C:
event := &proto.LifecycleEvent{
EventType: "PROGRESS",
- AgentId: s.agentID,
Timestamp: timestamppb.Now(),
Metadata: map[string]string{
"status": "healthy",
diff --git a/internal/controller/session.go b/internal/controller/session.go
index bae80bc..060fedc 100644
--- a/internal/controller/session.go
+++ b/internal/controller/session.go
@@ -170,7 +170,6 @@ func (sm *SessionManager) LoadSessionFromCheckpoint(sessionID string, checkpoint
event := &proto.LifecycleEvent{
EventType: getStringFromData(entry.Data, "event_type"),
- AgentId: getStringFromData(entry.Data, "agent_id"),
Timestamp: timestamp,
}
session.LifecycleEvents = append(session.LifecycleEvents, event)
diff --git a/internal/eventlog/file.go b/internal/eventlog/file.go
index 0015f53..4d69fcc 100644
--- a/internal/eventlog/file.go
+++ b/internal/eventlog/file.go
@@ -125,7 +125,6 @@ func (e *FileEventLog) AppendLifecycleEvent(ctx context.Context, event *proto.Li
data := map[string]interface{}{
"event_type": event.EventType,
- "agent_id": event.AgentId,
"timestamp_seconds": timestampSeconds,
"timestamp_nanos": timestampNanos,
"metadata": event.Metadata,
diff --git a/proto/gar.pb.go b/proto/gar.pb.go
index 87cbe25..08a6c90 100644
--- a/proto/gar.pb.go
+++ b/proto/gar.pb.go
@@ -154,9 +154,8 @@ func (x *Content) GetData() string {
type LifecycleEvent struct {
state protoimpl.MessageState `protogen:"open.v1"`
EventType string `protobuf:"bytes,1,opt,name=event_type,json=eventType,proto3" json:"event_type,omitempty"` // Event type: "PROGRESS", "HEARTBEAT"
- AgentId string `protobuf:"bytes,2,opt,name=agent_id,json=agentId,proto3" json:"agent_id,omitempty"` // Unique identifier of the agent
- Timestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp of the event
- Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Additional event metadata
+ Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Timestamp of the event
+ Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` // Additional event metadata
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@@ -198,13 +197,6 @@ func (x *LifecycleEvent) GetEventType() string {
return ""
}
-func (x *LifecycleEvent) GetAgentId() string {
- if x != nil {
- return x.AgentId
- }
- return ""
-}
-
func (x *LifecycleEvent) GetTimestamp() *timestamppb.Timestamp {
if x != nil {
return x.Timestamp
@@ -843,13 +835,12 @@ const file_proto_gar_proto_rawDesc = "" +
"\x04role\x18\x01 \x01(\tR\x04role\x12\x12\n" +
"\x04type\x18\x02 \x01(\tR\x04type\x12\x1a\n" +
"\bmimetype\x18\x03 \x01(\tR\bmimetype\x12\x12\n" +
- "\x04data\x18\x04 \x01(\tR\x04data\"\x82\x02\n" +
+ "\x04data\x18\x04 \x01(\tR\x04data\"\xe7\x01\n" +
"\x0eLifecycleEvent\x12\x1d\n" +
"\n" +
- "event_type\x18\x01 \x01(\tR\teventType\x12\x19\n" +
- "\bagent_id\x18\x02 \x01(\tR\aagentId\x128\n" +
- "\ttimestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12?\n" +
- "\bmetadata\x18\x04 \x03(\v2#.proto.LifecycleEvent.MetadataEntryR\bmetadata\x1a;\n" +
+ "event_type\x18\x01 \x01(\tR\teventType\x128\n" +
+ "\ttimestamp\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\ttimestamp\x12?\n" +
+ "\bmetadata\x18\x03 \x03(\v2#.proto.LifecycleEvent.MetadataEntryR\bmetadata\x1a;\n" +
"\rMetadataEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value:\x028\x01\"/\n" +
diff --git a/proto/gar.proto b/proto/gar.proto
index 268330e..bfb4540 100644
--- a/proto/gar.proto
+++ b/proto/gar.proto
@@ -19,9 +19,8 @@ message Content {
// LifecycleEvent represents events from agent lifecycle
message LifecycleEvent {
string event_type = 1; // Event type: "PROGRESS", "HEARTBEAT"
- string agent_id = 2; // Unique identifier of the agent
- google.protobuf.Timestamp timestamp = 3; // Timestamp of the event
- map<string, string> metadata = 4; // Additional event metadata
+ google.protobuf.Timestamp timestamp = 2; // Timestamp of the event
+ map<string, string> metadata = 3; // Additional event metadata
}
// HealthCheckRequest for agent health checks
diff --git a/python/gar.py b/python/gar.py
index 4c90fa6..9e5743c 100644
--- a/python/gar.py
+++ b/python/gar.py
@@ -71,7 +71,6 @@ class Agent:
timestamp.GetCurrentTime()
event = pb2.LifecycleEvent(
event_type="HEARTBEAT",
- agent_id=agent.agent_id,
timestamp=timestamp
)
yield event