Skip to content

armgit / ax

Public Imported from GitHub
0

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

Go

Remove unused/obsolete states

JBD91c824e073d2
diff --git a/internal/controller/loop.go b/internal/controller/loop.go
index e15c46a..180d467 100644
--- a/internal/controller/loop.go
+++ b/internal/controller/loop.go
@@ -111,9 +111,6 @@ func (e *LoopExecutor) Resume(ctx context.Context, sessionID string) error {
}
// Check if session is in a resumable state
- if session.State == proto.State_STATE_COMPLETED {
- return fmt.Errorf("session already completed")
- }
if session.State == proto.State_STATE_FAILED {
return fmt.Errorf("session failed and cannot be resumed")
}
@@ -147,7 +144,6 @@ func (e *LoopExecutor) runLoop(ctx context.Context, session *Session) error {
// If no task, we're done
if task == nil {
- session.SetState(proto.State_STATE_COMPLETED)
return nil
}
@@ -178,7 +174,6 @@ func (e *LoopExecutor) runLoop(ctx context.Context, session *Session) error {
// If goal achieved, complete the session
if goalAchieved {
- session.SetState(proto.State_STATE_COMPLETED)
return nil
}
}
diff --git a/internal/server/server.go b/internal/server/server.go
index e1a510a..d90fd82 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -43,7 +43,7 @@ func (s *Server) TriggerSession(req *proto.TriggerSessionRequest, stream grpc.Se
}
if err := stream.Send(&proto.TriggerSessionResponse{
- State: proto.State_STATE_STARTING,
+ State: proto.State_STATE_RUNNING,
SessionId: sessionID,
}); err != nil {
return err
diff --git a/proto/gar.pb.go b/proto/gar.pb.go
index f88297f..cfa2803 100644
--- a/proto/gar.pb.go
+++ b/proto/gar.pb.go
@@ -27,30 +27,21 @@ type State int32
const (
State_STATE_UNSPECIFIED State = 0 // Unspecified state
- State_STATE_STARTING State = 1
- State_STATE_RUNNING State = 2 // Session is currently running
- State_STATE_COMPLETED State = 3 // Session completed successfully
- State_STATE_FAILED State = 4 // Session failed
- State_STATE_UNKNOWN State = 5
+ State_STATE_RUNNING State = 1 // Session is currently running
+ State_STATE_FAILED State = 2 // Session failed
)
// Enum value maps for State.
var (
State_name = map[int32]string{
0: "STATE_UNSPECIFIED",
- 1: "STATE_STARTING",
- 2: "STATE_RUNNING",
- 3: "STATE_COMPLETED",
- 4: "STATE_FAILED",
- 5: "STATE_UNKNOWN",
+ 1: "STATE_RUNNING",
+ 2: "STATE_FAILED",
}
State_value = map[string]int32{
"STATE_UNSPECIFIED": 0,
- "STATE_STARTING": 1,
- "STATE_RUNNING": 2,
- "STATE_COMPLETED": 3,
- "STATE_FAILED": 4,
- "STATE_UNKNOWN": 5,
+ "STATE_RUNNING": 1,
+ "STATE_FAILED": 2,
}
)
@@ -870,14 +861,11 @@ const file_proto_gar_proto_rawDesc = "" +
"\x15RegisterAgentResponse\"3\n" +
"\x16UnregisterAgentRequest\x12\x19\n" +
"\bagent_id\x18\x01 \x01(\tR\aagentId\"\x19\n" +
- "\x17UnregisterAgentResponse*\x7f\n" +
+ "\x17UnregisterAgentResponse*C\n" +
"\x05State\x12\x15\n" +
- "\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n" +
- "\x0eSTATE_STARTING\x10\x01\x12\x11\n" +
- "\rSTATE_RUNNING\x10\x02\x12\x13\n" +
- "\x0fSTATE_COMPLETED\x10\x03\x12\x10\n" +
- "\fSTATE_FAILED\x10\x04\x12\x11\n" +
- "\rSTATE_UNKNOWN\x10\x052\xc8\x01\n" +
+ "\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n" +
+ "\rSTATE_RUNNING\x10\x01\x12\x10\n" +
+ "\fSTATE_FAILED\x10\x022\xc8\x01\n" +
"\fAgentService\x12-\n" +
"\aProcess\x12\x0e.proto.Content\x1a\x0e.proto.Content(\x010\x01\x12C\n" +
"\x0fStreamLifecycle\x12\x15.proto.LifecycleEvent\x1a\x15.proto.LifecycleEvent(\x010\x01\x12D\n" +
diff --git a/proto/gar.proto b/proto/gar.proto
index 01ac6ad..a7d62ea 100644
--- a/proto/gar.proto
+++ b/proto/gar.proto
@@ -48,11 +48,8 @@ service AgentService {
// State represents the state of a session
enum State {
STATE_UNSPECIFIED = 0; // Unspecified state
- STATE_STARTING = 1;
- STATE_RUNNING = 2; // Session is currently running
- STATE_COMPLETED = 3; // Session completed successfully
- STATE_FAILED = 4; // Session failed
- STATE_UNKNOWN = 5;
+ STATE_RUNNING = 1; // Session is currently running
+ STATE_FAILED = 2; // Session failed
}
// TriggerSessionRequest for triggering a new session