Skip to content

armgit / ax

Public Imported from GitHub
0

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

Go

Make Session ID read only

Jaana Dogan061835ebe337
diff --git a/internal/controller/loop.go b/internal/controller/loop.go
index 194486a..ce1c4ec 100644
--- a/internal/controller/loop.go
+++ b/internal/controller/loop.go
@@ -116,7 +116,7 @@ func (e *LoopExecutor) runLoop(ctx context.Context, session *Session, handler ag
}
return nil
}
- if err := e.executeTask(ctx, session.ID, task, taskOutputHandler); err != nil {
+ if err := e.executeTask(ctx, session.ID(), task, taskOutputHandler); err != nil {
return err
}
diff --git a/internal/controller/session.go b/internal/controller/session.go
index 2fbd95d..cb2fa28 100644
--- a/internal/controller/session.go
+++ b/internal/controller/session.go
@@ -28,7 +28,7 @@ import (
// Session represents an agentic loop execution session.
// It maintains in-memory state and uses event log for durability.
type Session struct {
- ID string
+ id string
mu sync.RWMutex
eventLog eventlog.EventLog
@@ -75,7 +75,7 @@ func (sm *SessionManager) NewSession(sessionID string) (*Session, error) {
now := time.Now()
session := &Session{
- ID: sessionID,
+ id: sessionID,
state: proto.State_STATE_UNSPECIFIED,
currentStep: 0,
activeAgents: []string{},
@@ -119,7 +119,7 @@ func (sm *SessionManager) LoadSessionFromCheckpoint(ctx context.Context, session
// Reconstruct session state from event log
session := &Session{
- ID: sessionID,
+ id: sessionID,
state: state,
currentStep: 0,
activeAgents: []string{},
@@ -287,6 +287,10 @@ func (s *Session) SetState(ctx context.Context, state proto.State) error {
return nil
}
+func (s *Session) ID() string {
+ return s.id
+}
+
func (s *Session) State() proto.State {
s.mu.RLock()
defer s.mu.RUnlock()