Agent Executor (AX) is Google's open agentic orchestration runtime
Go
refactor: rename seq to step across protocol and internal controller logic
Jaana Doganbab973e877a3
diff --git a/README.md b/README.mdindex f2574b5..dc3c950 100644--- a/README.md+++ b/README.md@@ -151,16 +151,16 @@ ax exec \--input "Show me the contents of README.md"```-If the client gets disconnected, pass the last sequence it saw to+If the client gets disconnected, pass the last step it saw toreplay the events it missed. This catches the client up; it does notrewind the conversation.-In this example, we catch up a client from sequence number 12:+In this example, we catch up a client from step number 12:```bashax exec \--conversation d85a4b4e-c53b-4c84-b879-f10d905bce40 \- --last-seq 12 \+ --last-step 12 \--resume```@@ -197,7 +197,7 @@ ax exec \[--server <address>] \[--ax-config <file>] \[--resume] \- [--last-seq <number>]+ [--last-step <number>]```Executes a new harness execution or automatically resumes an existing one. If the conversation ID already exists, the execution will be resumed from its last state.@@ -211,7 +211,7 @@ Options:- `--server`: gRPC controller server address (optional. If not provided, runs with a local built-in AX server)- `--ax-config`: Path to YAML configuration file (only used with a local built-in AX server, default: "ax.yaml")- `--resume`: Resume a conversation without inputs (optional, mutually exclusive with `--input`)-- `--last-seq`: Last sequence number seen by the client to resume from (optional). The server replays any later events so the client can catch up after a disconnect.+- `--last-step`: Last step number seen by the client to resume from (optional). The server replays any later events so the client can catch up after a disconnect.**Examples:**diff --git a/cmd/ax/dashboard.go b/cmd/ax/dashboard.goindex e518f74..5762964 100644--- a/cmd/ax/dashboard.go+++ b/cmd/ax/dashboard.go@@ -60,7 +60,7 @@ type ConversationResponse struct {ID string `json:"id"`Agent string `json:"agent"`Status string `json:"status"`- LastSeq int32 `json:"last_seq"`+ LastStep int32 `json:"last_step"`Duration string `json:"duration"`}@@ -194,18 +194,18 @@ func fetchConversations(ctx context.Context, db *sql.DB) ([]ConversationResponsequery := `SELECTc.conversation_id,- c.last_seq,+ c.last_step,c.state,e.agent_id,e.start_time,e.end_timeFROM (- SELECT conversation_id, seq AS last_seq,+ SELECT conversation_id, step AS last_step,json_extract(payload, '$.exec_id') AS exec_id,json_extract(payload, '$.state') AS stateFROM conversation_log- WHERE (conversation_id, seq) IN (- SELECT conversation_id, MAX(seq)+ WHERE (conversation_id, step) IN (+ SELECT conversation_id, MAX(step)FROM conversation_logGROUP BY conversation_id)@@ -229,12 +229,12 @@ LEFT JOIN (convs := []ConversationResponse{}for rows.Next() {var id string- var lastSeq int32+ var lastStep int32var state stringvar agentID sql.NullStringvar startTimeStr, endTimeStr sql.NullString- err := rows.Scan(&id, &lastSeq, &state, &agentID, &startTimeStr, &endTimeStr)+ err := rows.Scan(&id, &lastStep, &state, &agentID, &startTimeStr, &endTimeStr)if err != nil {return nil, err}@@ -272,7 +272,7 @@ LEFT JOIN (ID: id,Agent: agent,Status: status,- LastSeq: lastSeq,+ LastStep: lastStep,Duration: durationStr,})}diff --git a/cmd/ax/dashboard_test.go b/cmd/ax/dashboard_test.goindex df41229..ea5ceab 100644--- a/cmd/ax/dashboard_test.go+++ b/cmd/ax/dashboard_test.go@@ -35,7 +35,7 @@ func TestFetchConversations(t *testing.T) {schema := `CREATE TABLE conversation_log (conversation_id TEXT,- seq INTEGER,+ step INTEGER,timestamp DATETIME,payload TEXT);@@ -53,7 +53,7 @@ func TestFetchConversations(t *testing.T) {// Insert test data// Conversation 1: Only conversation_log (V2 execution without execution_log)_, err = db.Exec(`- INSERT INTO conversation_log (conversation_id, seq, timestamp, payload)+ INSERT INTO conversation_log (conversation_id, step, timestamp, payload)VALUES ('conv-1', 1, ?, '{"exec_id": "exec-1", "state": "STATE_PENDING"}')`, time.Now().Format(time.RFC3339))if err != nil {@@ -66,7 +66,7 @@ func TestFetchConversations(t *testing.T) {end := now_, err = db.Exec(`- INSERT INTO conversation_log (conversation_id, seq, timestamp, payload)+ INSERT INTO conversation_log (conversation_id, step, timestamp, payload)VALUES ('conv-2', 5, ?, '{"exec_id": "exec-2", "state": "STATE_COMPLETED"}')`, end.Format(time.RFC3339))if err != nil {@@ -114,8 +114,8 @@ func TestFetchConversations(t *testing.T) {if c1.Duration != "N/A" {t.Errorf("conv-1 expected duration N/A, got %q", c1.Duration)}- if c1.LastSeq != 1 {- t.Errorf("conv-1 expected last_seq 1, got %d", c1.LastSeq)+ if c1.LastStep != 1 {+ t.Errorf("conv-1 expected last_step 1, got %d", c1.LastStep)}// Check conv-2@@ -133,7 +133,7 @@ func TestFetchConversations(t *testing.T) {if c2.Duration != "5.0s" {t.Errorf("conv-2 expected duration 5.0s, got %q", c2.Duration)}- if c2.LastSeq != 5 {- t.Errorf("conv-2 expected last_seq 5, got %d", c2.LastSeq)+ if c2.LastStep != 5 {+ t.Errorf("conv-2 expected last_step 5, got %d", c2.LastStep)}}diff --git a/cmd/ax/exec.go b/cmd/ax/exec.goindex f7f1473..eae517f 100644--- a/cmd/ax/exec.go+++ b/cmd/ax/exec.go@@ -42,7 +42,7 @@ var (execServerAddr stringexecAXConfigFile stringexecResume bool // allow resuming an execution without inputs- execLastSeq int32+ execLastStep int32)var execCmd = &cobra.Command{@@ -63,7 +63,7 @@ func init() {execCmd.Flags().StringVar(&execServerAddr, "server", "", "gRPC controller server address (if specified, connects to remote server; otherwise runs with a local built-in AX server)")execCmd.Flags().StringVar(&execAXConfigFile, "ax-config", "ax.yaml", "Path to YAML configuration file (only used with a local built-in AX server)")execCmd.Flags().BoolVar(&execResume, "resume", false, "Resume a conversation without inputs")- execCmd.Flags().Int32Var(&execLastSeq, "last-seq", 0, "Last sequence number seen by the client")+ execCmd.Flags().Int32Var(&execLastStep, "last-step", 0, "Last step number seen by the client")execCmd.MarkFlagsMutuallyExclusive("input", "resume")execCmd.MarkFlagsMutuallyExclusive("config", "config-file")}@@ -134,10 +134,10 @@ func runExec(cmd *cobra.Command, args []string) error {harnessConfig = []byte(execConfig)}- return execLoop(ctx, execConversationID, execHarnessID, harnessConfig, execInput, execLastSeq)+ return execLoop(ctx, execConversationID, execHarnessID, harnessConfig, execInput, execLastStep)}-func execLoop(ctx context.Context, id string, harnessID string, harnessConfig []byte, input string, lastSeq int32) error {+func execLoop(ctx context.Context, id string, harnessID string, harnessConfig []byte, input string, lastStep int32) error {d := internal.NewDisplay(id, os.Stdout)d.DisplayHeader()@@ -175,9 +175,9 @@ func execLoop(ctx context.Context, id string, harnessID string, harnessConfig []HarnessId: harnessID,HarnessConfig: harnessConfig,Inputs: inputs,- LastSeq: lastSeq,+ LastStep: lastStep,})- lastSeq = 0 // disable resuming from sequence, user sees the seq on the screen+ lastStep = 0 // disable resuming from step, user sees the step on the screeninterruptHandler.ClearActiveCancel()cancel()@@ -297,14 +297,14 @@ func runAutoExec(ctx context.Context, d *internal.Display, req *proto.ExecRequesfunc runExecHeadless(ctx context.Context, d *internal.Display, req *proto.ExecRequest) (*proto.ConfirmationContent, error) {var confirmation *proto.ConfirmationContent- var lastSeq int32+ var lastStep int32outputHandler := cliutil.ExecHandler(func(resp *proto.ExecResponse) error {for _, m := range resp.Outputs {if conf := m.GetContent().GetConfirmation(); conf != nil {confirmation = conf}}- lastSeq = resp.Seq+ lastStep = resp.StepdisplayContents(d, resp.Outputs)return nil})@@ -313,7 +313,7 @@ func runExecHeadless(ctx context.Context, d *internal.Display, req *proto.ExecRe}if confirmation == nil {- d.FinishOutput(fmt.Sprintf("seq=%d", lastSeq))+ d.FinishOutput(fmt.Sprintf("step=%d", lastStep))}return confirmation, nil}@@ -332,7 +332,7 @@ func runExecServer(ctx context.Context, d *internal.Display, req *proto.ExecRequ}var confirmation *proto.ConfirmationContent- var lastSeq int32+ var lastStep int32for {resp, err := stream.Recv()if err == io.EOF {@@ -341,7 +341,7 @@ func runExecServer(ctx context.Context, d *internal.Display, req *proto.ExecRequif err != nil {return nil, fmt.Errorf("error receiving response: %w", err)}- lastSeq = resp.Seq+ lastStep = resp.Stepif resp.Outputs != nil {for _, m := range resp.Outputs {if conf := m.GetContent().GetConfirmation(); conf != nil {@@ -352,7 +352,7 @@ func runExecServer(ctx context.Context, d *internal.Display, req *proto.ExecRequ}}if confirmation == nil {- d.FinishOutput(fmt.Sprintf("seq=%d", lastSeq))+ d.FinishOutput(fmt.Sprintf("step=%d", lastStep))}return confirmation, nil}diff --git a/cmd/ax/web/index.html b/cmd/ax/web/index.htmlindex fc49046..1f69c0c 100644--- a/cmd/ax/web/index.html+++ b/cmd/ax/web/index.html@@ -831,7 +831,7 @@ body {<th>Conversation ID</th><th>Agent</th><th>Status</th>- <th>Last Seq</th>+ <th>Last Step</th><th>Duration</th><th>Actions</th></tr>@@ -984,7 +984,7 @@ function renderDashboard() {${esc(c.status)}</span></td>- <td>${c.last_seq}</td>+ <td>${c.last_step}</td><td>${esc(c.duration)}</td><td><button class="btn-trace" onclick="openTraceView('${esc(c.id)}')">diff --git a/internal/controller/controller.go b/internal/controller/controller.goindex a377528..ac7a129 100644--- a/internal/controller/controller.go+++ b/internal/controller/controller.go@@ -152,7 +152,7 @@ type harnessHandler struct {func (a *harnessHandler) OnMessage(ctx context.Context, execID string, msg *proto.Message) error {// Log every response received from the harness// TODO(anj): The harness should send the full input sent to get this particular response.- seq, err := a.logger.LogOutputs(ctx, []*proto.Message{msg}, proto.State_STATE_PENDING)+ step, err := a.logger.LogOutputs(ctx, []*proto.Message{msg}, proto.State_STATE_PENDING)if err != nil {slog.WarnContext(ctx, "Failed to log streamed message to event log",slog.String("conversation_id", a.logger.conversationID),@@ -165,7 +165,7 @@ func (a *harnessHandler) OnMessage(ctx context.Context, execID string, msg *prot}return a.execHandler(&proto.ExecResponse{Outputs: []*proto.Message{msg},- Seq: seq,+ Step: step,})}diff --git a/internal/controller/eventlog/eventlogtest/eventlog.go b/internal/controller/eventlog/eventlogtest/eventlog.goindex f24abe5..5823513 100644--- a/internal/controller/eventlog/eventlogtest/eventlog.go+++ b/internal/controller/eventlog/eventlogtest/eventlog.go@@ -32,19 +32,19 @@ func (m *MemoryEventLog) Append(_ context.Context, event *proto.ConversationEvenm.mu.Lock()defer m.mu.Unlock()- seq := event.Seq- if seq == 0 {- maxSeq := int32(0)+ step := event.Step+ if step == 0 {+ maxStep := int32(0)for _, ev := range m.AllEvents {- if ev.ConversationId == event.ConversationId && ev.Seq > maxSeq {- maxSeq = ev.Seq+ if ev.ConversationId == event.ConversationId && ev.Step > maxStep {+ maxStep = ev.Step}}- seq = maxSeq + 1- event.Seq = seq+ step = maxStep + 1+ event.Step = step}m.AllEvents = append(m.AllEvents, event)- return seq, nil+ return step, nil}func (m *MemoryEventLog) Events(_ context.Context, conversationID string) ([]*proto.ConversationEvent, error) {diff --git a/internal/controller/eventlog/postgres.go b/internal/controller/eventlog/postgres.goindex c99c103..db3b4e5 100644--- a/internal/controller/eventlog/postgres.go+++ b/internal/controller/eventlog/postgres.go@@ -44,9 +44,9 @@ func OpenPostgresEventLog(dsn string) (EventLog, error) {if _, err := db.ExecContext(ctx, `CREATE TABLE IF NOT EXISTS conversation_log (conversation_id TEXT NOT NULL,- seq INTEGER NOT NULL,+ step INTEGER NOT NULL,payload TEXT NOT NULL,- PRIMARY KEY (conversation_id, seq)+ PRIMARY KEY (conversation_id, step))`); err != nil {db.Close()return nil, fmt.Errorf("postgres_eventlog: create conversation_log table: %w", err)diff --git a/internal/controller/eventlog/sql.go b/internal/controller/eventlog/sql.goindex 522b671..e584285 100644--- a/internal/controller/eventlog/sql.go+++ b/internal/controller/eventlog/sql.go@@ -33,7 +33,7 @@ type sqlEventLog struct {}// Append serializes the event to JSON and inserts it into the database.-func (l *sqlEventLog) Append(ctx context.Context, event *proto.ConversationEvent) (seq int32, err error) {+func (l *sqlEventLog) Append(ctx context.Context, event *proto.ConversationEvent) (step int32, err error) {ctx, endSpan := l.startSpan(ctx, "Append", event.ConversationId)defer func() { endSpan(err) }()@@ -43,12 +43,12 @@ func (l *sqlEventLog) Append(ctx context.Context, event *proto.ConversationEvent}defer tx.Rollback()- seq = event.Seq- if seq == 0 {- if err := tx.QueryRowContext(ctx, "SELECT COALESCE(MAX(seq), 0) + 1 FROM conversation_log WHERE conversation_id = $1", event.ConversationId).Scan(&seq); err != nil {- return 0, fmt.Errorf("eventlog: compute seq: %w", err)+ step = event.Step+ if step == 0 {+ if err := tx.QueryRowContext(ctx, "SELECT COALESCE(MAX(step), 0) + 1 FROM conversation_log WHERE conversation_id = $1", event.ConversationId).Scan(&step); err != nil {+ return 0, fmt.Errorf("eventlog: compute step: %w", err)}- event.Seq = seq+ event.Step = step}payload, err := marshalOpts.Marshal(event)@@ -57,8 +57,8 @@ func (l *sqlEventLog) Append(ctx context.Context, event *proto.ConversationEvent}if _, err := tx.ExecContext(ctx,- "INSERT INTO conversation_log (conversation_id, seq, payload) VALUES ($1, $2, $3)",- event.ConversationId, event.Seq, string(payload)); err != nil {+ "INSERT INTO conversation_log (conversation_id, step, payload) VALUES ($1, $2, $3)",+ event.ConversationId, event.Step, string(payload)); err != nil {return 0, fmt.Errorf("eventlog: insert conversation: %w", err)}@@ -66,15 +66,15 @@ func (l *sqlEventLog) Append(ctx context.Context, event *proto.ConversationEventreturn 0, fmt.Errorf("eventlog: commit: %w", err)}- return seq, nil+ return step, nil}-// Events retrieves all events from the database for a conversation, ordered by seq.+// Events retrieves all events from the database for a conversation, ordered by step.func (l *sqlEventLog) Events(ctx context.Context, conversationID string) (events []*proto.ConversationEvent, err error) {ctx, endSpan := l.startSpan(ctx, "Events", conversationID)defer func() { endSpan(err) }()- rows, err := l.db.QueryContext(ctx, "SELECT payload FROM conversation_log WHERE conversation_id = $1 ORDER BY seq", conversationID)+ rows, err := l.db.QueryContext(ctx, "SELECT payload FROM conversation_log WHERE conversation_id = $1 ORDER BY step", conversationID)if err != nil {return nil, fmt.Errorf("eventlog: query conversation: %w", err)}diff --git a/internal/controller/eventlog/sql_test.go b/internal/controller/eventlog/sql_test.goindex 86eb4cf..4f07b07 100644--- a/internal/controller/eventlog/sql_test.go+++ b/internal/controller/eventlog/sql_test.go@@ -43,8 +43,8 @@ func testEventLog(t *testing.T, newLog func(t *testing.T) EventLog) {t.Cleanup(func() { _ = log.DeleteAll(ctx, conv) })// 1. Conversation log.- cev1 := &proto.ConversationEvent{ConversationId: conv, Seq: 1, ExecId: task1}- cev2 := &proto.ConversationEvent{ConversationId: conv, Seq: 2, ExecId: task2}+ cev1 := &proto.ConversationEvent{ConversationId: conv, Step: 1, ExecId: task1}+ cev2 := &proto.ConversationEvent{ConversationId: conv, Step: 2, ExecId: task2}if _, err := log.Append(ctx, cev1); err != nil {t.Fatalf("failed to append cev1: %v", err)}@@ -59,8 +59,8 @@ func testEventLog(t *testing.T, newLog func(t *testing.T) EventLog) {if len(cEvents) != 2 {t.Fatalf("expected 2 conversation events, got %d", len(cEvents))}- if cEvents[0].Seq != 1 || cEvents[1].Seq != 2 {- t.Errorf("conversation events out of order: %d, %d", cEvents[0].Seq, cEvents[1].Seq)+ if cEvents[0].Step != 1 || cEvents[1].Step != 2 {+ t.Errorf("conversation events out of order: %d, %d", cEvents[0].Step, cEvents[1].Step)}if cEvents[0].ExecId != task1 || cEvents[1].ExecId != task2 {t.Errorf("conversation events mismatch: %q, %q", cEvents[0].ExecId, cEvents[1].ExecId)@@ -97,10 +97,10 @@ func testEventLog(t *testing.T, newLog func(t *testing.T) EventLog) {_ = log.DeleteAll(ctx, conv2)})- if _, err := log.Append(ctx, &proto.ConversationEvent{ConversationId: conv1, Seq: 1, ExecId: task1}); err != nil {+ if _, err := log.Append(ctx, &proto.ConversationEvent{ConversationId: conv1, Step: 1, ExecId: task1}); err != nil {t.Fatalf("append: %v", err)}- if _, err := log.Append(ctx, &proto.ConversationEvent{ConversationId: conv2, Seq: 1, ExecId: task3}); err != nil {+ if _, err := log.Append(ctx, &proto.ConversationEvent{ConversationId: conv2, Step: 1, ExecId: task3}); err != nil {t.Fatalf("append: %v", err)}@@ -118,9 +118,9 @@ func testEventLog(t *testing.T, newLog func(t *testing.T) EventLog) {})- // AutoSeq exercises the seq==0 auto-assignment path: appends with Seq unset+ // AutoStep exercises the step==0 auto-assignment path: appends with Step unset// receive sequential numbers starting at 1.- t.Run("AutoSeq", func(t *testing.T) {+ t.Run("AutoStep", func(t *testing.T) {ctx := context.Background()log := newLog(t)@@ -130,12 +130,12 @@ func testEventLog(t *testing.T, newLog func(t *testing.T) EventLog) {const n = 3for i := int32(1); i <= n; i++ {- seq, err := log.Append(ctx, &proto.ConversationEvent{ConversationId: conv, ExecId: "t"})+ step, err := log.Append(ctx, &proto.ConversationEvent{ConversationId: conv, ExecId: "t"})if err != nil {- t.Fatalf("auto-seq append failed: %v", err)+ t.Fatalf("auto-step append failed: %v", err)}- if seq != i {- t.Errorf("expected seq %d, got %d", i, seq)+ if step != i {+ t.Errorf("expected step %d, got %d", i, step)}}@@ -147,8 +147,8 @@ func testEventLog(t *testing.T, newLog func(t *testing.T) EventLog) {t.Fatalf("expected %d events, got %d", n, len(events))}for i, e := range events {- if e.Seq != int32(i+1) {- t.Errorf("event %d: expected seq %d, got %d", i, i+1, e.Seq)+ if e.Step != int32(i+1) {+ t.Errorf("event %d: expected step %d, got %d", i, i+1, e.Step)}}})diff --git a/internal/controller/eventlog/sqlite.go b/internal/controller/eventlog/sqlite.goindex b29ea5a..ad3f411 100644--- a/internal/controller/eventlog/sqlite.go+++ b/internal/controller/eventlog/sqlite.go@@ -43,9 +43,9 @@ func OpenSQLiteEventLog(path string) (EventLog, error) {if _, err := db.Exec(`CREATE TABLE IF NOT EXISTS conversation_log (conversation_id TEXT NOT NULL,- seq INTEGER NOT NULL,+ step INTEGER NOT NULL,payload TEXT NOT NULL,- PRIMARY KEY (conversation_id, seq)+ PRIMARY KEY (conversation_id, step))`); err != nil {db.Close()return nil, fmt.Errorf("sqlite_eventlog: create conversation_log table: %w", err)diff --git a/proto/ax.pb.go b/proto/ax.pb.goindex 94b1ffe..3fa254f 100644--- a/proto/ax.pb.go+++ b/proto/ax.pb.go@@ -204,7 +204,7 @@ func (x *Message) GetContent() *Content {type ConversationEvent struct {state protoimpl.MessageState `protogen:"open.v1"`ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"`- Seq int32 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"`+ Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"`ExecId string `protobuf:"bytes,3,opt,name=exec_id,json=execId,proto3" json:"exec_id,omitempty"`HarnessId string `protobuf:"bytes,4,opt,name=harness_id,json=harnessId,proto3" json:"harness_id,omitempty"`HarnessConfig *structpb.Struct `protobuf:"bytes,5,opt,name=harness_config,json=harnessConfig,proto3" json:"harness_config,omitempty"`@@ -251,9 +251,9 @@ func (x *ConversationEvent) GetConversationId() string {return ""}-func (x *ConversationEvent) GetSeq() int32 {+func (x *ConversationEvent) GetStep() int32 {if x != nil {- return x.Seq+ return x.Step}return 0}@@ -736,7 +736,7 @@ type ExecRequest struct {state protoimpl.MessageState `protogen:"open.v1"`ConversationId string `protobuf:"bytes,1,opt,name=conversation_id,json=conversationId,proto3" json:"conversation_id,omitempty"` // Unique conversation identifierInputs []*Message `protobuf:"bytes,2,rep,name=inputs,proto3" json:"inputs,omitempty"` // New inputs- LastSeq int32 `protobuf:"varint,3,opt,name=last_seq,json=lastSeq,proto3" json:"last_seq,omitempty"` // Last sequence number seen by the client+ LastStep int32 `protobuf:"varint,3,opt,name=last_step,json=lastStep,proto3" json:"last_step,omitempty"` // Last step number seen by the clientHarnessId string `protobuf:"bytes,4,opt,name=harness_id,json=harnessId,proto3" json:"harness_id,omitempty"` // Harness ID, empty selects the default harnessHarnessConfig []byte `protobuf:"bytes,5,opt,name=harness_config,json=harnessConfig,proto3" json:"harness_config,omitempty"` // Per-request harness configuration (opaque JSON), if anyunknownFields protoimpl.UnknownFields@@ -787,9 +787,9 @@ func (x *ExecRequest) GetInputs() []*Message {return nil}-func (x *ExecRequest) GetLastSeq() int32 {+func (x *ExecRequest) GetLastStep() int32 {if x != nil {- return x.LastSeq+ return x.LastStep}return 0}@@ -812,7 +812,7 @@ func (x *ExecRequest) GetHarnessConfig() []byte {type ExecResponse struct {state protoimpl.MessageState `protogen:"open.v1"`Outputs []*Message `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"` // Output content- Seq int32 `protobuf:"varint,2,opt,name=seq,proto3" json:"seq,omitempty"` // Seq of the outputs+ Step int32 `protobuf:"varint,2,opt,name=step,proto3" json:"step,omitempty"` // Step of the outputsunknownFields protoimpl.UnknownFieldssizeCache protoimpl.SizeCache}@@ -854,9 +854,9 @@ func (x *ExecResponse) GetOutputs() []*Message {return nil}-func (x *ExecResponse) GetSeq() int32 {+func (x *ExecResponse) GetStep() int32 {if x != nil {- return x.Seq+ return x.Step}return 0}@@ -948,10 +948,10 @@ const file_proto_ax_proto_rawDesc = "" +"\x0eproto/ax.proto\x12\x02ax\x1a\x1cgoogle/protobuf/struct.proto\x1a\x13proto/content.proto\"D\n" +"\aMessage\x12\x12\n" +"\x04role\x18\x01 \x01(\tR\x04role\x12%\n" +- "\acontent\x18\x02 \x01(\v2\v.ax.ContentR\acontent\"\x90\x02\n" ++ "\acontent\x18\x02 \x01(\v2\v.ax.ContentR\acontent\"\x92\x02\n" +"\x11ConversationEvent\x12'\n" +- "\x0fconversation_id\x18\x01 \x01(\tR\x0econversationId\x12\x10\n" +- "\x03seq\x18\x02 \x01(\x05R\x03seq\x12\x17\n" ++ "\x0fconversation_id\x18\x01 \x01(\tR\x0econversationId\x12\x12\n" ++ "\x04step\x18\x02 \x01(\x05R\x04step\x12\x17\n" +"\aexec_id\x18\x03 \x01(\tR\x06execId\x12\x1d\n" +"\n" +"harness_id\x18\x04 \x01(\tR\tharnessId\x12>\n" +@@ -983,17 +983,17 @@ const file_proto_ax_proto_rawDesc = "" +"\x0fconversation_id\x18\x01 \x01(\tR\x0econversationId\x12.\n" +"\aoutputs\x18\x02 \x01(\v2\x12.ax.HarnessOutputsH\x00R\aoutputs\x12\"\n" +"\x03end\x18\x03 \x01(\v2\x0e.ax.HarnessEndH\x00R\x03endB\x06\n" +- "\x04type\"\xbc\x01\n" ++ "\x04type\"\xbe\x01\n" +"\vExecRequest\x12'\n" +"\x0fconversation_id\x18\x01 \x01(\tR\x0econversationId\x12#\n" +- "\x06inputs\x18\x02 \x03(\v2\v.ax.MessageR\x06inputs\x12\x19\n" +- "\blast_seq\x18\x03 \x01(\x05R\alastSeq\x12\x1d\n" ++ "\x06inputs\x18\x02 \x03(\v2\v.ax.MessageR\x06inputs\x12\x1b\n" ++ "\tlast_step\x18\x03 \x01(\x05R\blastStep\x12\x1d\n" +"\n" +"harness_id\x18\x04 \x01(\tR\tharnessId\x12%\n" +- "\x0eharness_config\x18\x05 \x01(\fR\rharnessConfig\"G\n" ++ "\x0eharness_config\x18\x05 \x01(\fR\rharnessConfig\"I\n" +"\fExecResponse\x12%\n" +- "\aoutputs\x18\x01 \x03(\v2\v.ax.MessageR\aoutputs\x12\x10\n" +- "\x03seq\x18\x02 \x01(\x05R\x03seq\"D\n" ++ "\aoutputs\x18\x01 \x03(\v2\v.ax.MessageR\aoutputs\x12\x12\n" ++ "\x04step\x18\x02 \x01(\x05R\x04step\"D\n" +"\x19DeleteConversationRequest\x12'\n" +"\x0fconversation_id\x18\x01 \x01(\tR\x0econversationId\"\x1c\n" +"\x1aDeleteConversationResponse*l\n" +diff --git a/proto/ax.proto b/proto/ax.protoindex 675fb88..31b90a6 100644--- a/proto/ax.proto+++ b/proto/ax.proto@@ -35,7 +35,7 @@ message Message {// before the last execution is completed or failed.message ConversationEvent {string conversation_id = 1;- int32 seq = 2;+ int32 step = 2;string exec_id = 3;string harness_id = 4;google.protobuf.Struct harness_config = 5;@@ -118,7 +118,7 @@ enum CancelReason {message ExecRequest {string conversation_id = 1; // Unique conversation identifierrepeated Message inputs = 2; // New inputs- int32 last_seq = 3; // Last sequence number seen by the client+ int32 last_step = 3; // Last step number seen by the clientstring harness_id = 4; // Harness ID, empty selects the default harnessbytes harness_config = 5; // Per-request harness configuration (opaque JSON), if any@@ -127,7 +127,7 @@ message ExecRequest {// ExecResponse contains the result of an execution.message ExecResponse {repeated Message outputs = 1; // Output content- int32 seq = 2; // Seq of the outputs+ int32 step = 2; // Step of the outputs}service ExecutionService {diff --git a/python/proto/ax_pb2.py b/python/proto/ax_pb2.pyindex d147103..ca52c80 100644--- a/python/proto/ax_pb2.py+++ b/python/proto/ax_pb2.py@@ -1,17 +1,3 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.-# -*- coding: utf-8 -*-# Generated by the protocol buffer compiler. DO NOT EDIT!# source: proto/ax.proto@@ -30,7 +16,7 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2from proto import content_pb2 as proto_dot_content__pb2-DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eproto/ax.proto\x12\x02\x61x\x1a\x1cgoogle/protobuf/struct.proto\x1a\x13proto/content.proto\"5\n\x07Message\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x1c\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x0b.ax.Content\"\xc8\x01\n\x11\x43onversationEvent\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0b\n\x03seq\x18\x02 \x01(\x05\x12\x0f\n\x07\x65xec_id\x18\x03 \x01(\t\x12\x12\n\nharness_id\x18\x04 \x01(\t\x12/\n\x0eharness_config\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1d\n\x08messages\x18\x06 \x03(\x0b\x32\x0b.ax.Message\x12\x18\n\x05state\x18\x07 \x01(\x0e\x32\t.ax.State\"E\n\x0cHarnessStart\x12\x16\n\x0eharness_config\x18\x01 \x01(\x0c\x12\x1d\n\x08messages\x18\x02 \x03(\x0b\x32\x0b.ax.Message\"1\n\rHarnessCancel\x12 \n\x06reason\x18\x01 \x01(\x0e\x32\x10.ax.CancelReason\"\x8d\x01\n\x0eHarnessRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x12\n\nharness_id\x18\x02 \x01(\t\x12!\n\x05start\x18\x03 \x01(\x0b\x32\x10.ax.HarnessStartH\x00\x12#\n\x06\x63\x61ncel\x18\x04 \x01(\x0b\x32\x11.ax.HarnessCancelH\x00\x42\x06\n\x04type\"/\n\x0eHarnessOutputs\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ax.Message\"*\n\x05\x45rror\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\"@\n\nHarnessEnd\x12\x18\n\x05state\x18\x01 \x01(\x0e\x32\t.ax.State\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.ax.Error\"x\n\x0fHarnessResponse\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12%\n\x07outputs\x18\x02 \x01(\x0b\x32\x12.ax.HarnessOutputsH\x00\x12\x1d\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x0e.ax.HarnessEndH\x00\x42\x06\n\x04type\"\x81\x01\n\x0b\x45xecRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x1b\n\x06inputs\x18\x02 \x03(\x0b\x32\x0b.ax.Message\x12\x10\n\x08last_seq\x18\x03 \x01(\x05\x12\x12\n\nharness_id\x18\x04 \x01(\t\x12\x16\n\x0eharness_config\x18\x05 \x01(\x0c\"9\n\x0c\x45xecResponse\x12\x1c\n\x07outputs\x18\x01 \x03(\x0b\x32\x0b.ax.Message\x12\x0b\n\x03seq\x18\x02 \x01(\x05\"4\n\x19\x44\x65leteConversationRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\"\x1c\n\x1a\x44\x65leteConversationResponse*l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rSTATE_PENDING\x10\x01\x12\x10\n\x0cSTATE_FAILED\x10\x02\x12\x13\n\x0fSTATE_COMPLETED\x10\x03\x12\x12\n\x0eSTATE_CANCELED\x10\x04*\x8c\x01\n\x0c\x43\x61ncelReason\x12\x1d\n\x19\x43\x41NCEL_REASON_UNSPECIFIED\x10\x00\x12 \n\x1c\x43\x41NCEL_REASON_USER_REQUESTED\x10\x01\x12\x19\n\x15\x43\x41NCEL_REASON_TIMEOUT\x10\x02\x12 \n\x1c\x43\x41NCEL_REASON_INTERNAL_ERROR\x10\x03\x32H\n\x0eHarnessService\x12\x36\n\x07\x43onnect\x12\x12.ax.HarnessRequest\x1a\x13.ax.HarnessResponse(\x01\x30\x01\x32?\n\x10\x45xecutionService\x12+\n\x04\x45xec\x12\x0f.ax.ExecRequest\x1a\x10.ax.ExecResponse0\x01\x32j\n\x13\x43onversationService\x12S\n\x12\x44\x65leteConversation\x12\x1d.ax.DeleteConversationRequest\x1a\x1e.ax.DeleteConversationResponseB\x1cZ\x1agithub.com/google/ax/protob\x06proto3')+DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0eproto/ax.proto\x12\x02\x61x\x1a\x1cgoogle/protobuf/struct.proto\x1a\x13proto/content.proto\"5\n\x07Message\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x1c\n\x07\x63ontent\x18\x02 \x01(\x0b\x32\x0b.ax.Content\"\xc9\x01\n\x11\x43onversationEvent\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x0c\n\x04step\x18\x02 \x01(\x05\x12\x0f\n\x07\x65xec_id\x18\x03 \x01(\t\x12\x12\n\nharness_id\x18\x04 \x01(\t\x12/\n\x0eharness_config\x18\x05 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x1d\n\x08messages\x18\x06 \x03(\x0b\x32\x0b.ax.Message\x12\x18\n\x05state\x18\x07 \x01(\x0e\x32\t.ax.State\"E\n\x0cHarnessStart\x12\x16\n\x0eharness_config\x18\x01 \x01(\x0c\x12\x1d\n\x08messages\x18\x02 \x03(\x0b\x32\x0b.ax.Message\"1\n\rHarnessCancel\x12 \n\x06reason\x18\x01 \x01(\x0e\x32\x10.ax.CancelReason\"\x8d\x01\n\x0eHarnessRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x12\n\nharness_id\x18\x02 \x01(\t\x12!\n\x05start\x18\x03 \x01(\x0b\x32\x10.ax.HarnessStartH\x00\x12#\n\x06\x63\x61ncel\x18\x04 \x01(\x0b\x32\x11.ax.HarnessCancelH\x00\x42\x06\n\x04type\"/\n\x0eHarnessOutputs\x12\x1d\n\x08messages\x18\x01 \x03(\x0b\x32\x0b.ax.Message\"*\n\x05\x45rror\x12\x0c\n\x04\x63ode\x18\x01 \x01(\x05\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\"@\n\nHarnessEnd\x12\x18\n\x05state\x18\x01 \x01(\x0e\x32\t.ax.State\x12\x18\n\x05\x65rror\x18\x02 \x01(\x0b\x32\t.ax.Error\"x\n\x0fHarnessResponse\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12%\n\x07outputs\x18\x02 \x01(\x0b\x32\x12.ax.HarnessOutputsH\x00\x12\x1d\n\x03\x65nd\x18\x03 \x01(\x0b\x32\x0e.ax.HarnessEndH\x00\x42\x06\n\x04type\"\x82\x01\n\x0b\x45xecRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\x12\x1b\n\x06inputs\x18\x02 \x03(\x0b\x32\x0b.ax.Message\x12\x11\n\tlast_step\x18\x03 \x01(\x05\x12\x12\n\nharness_id\x18\x04 \x01(\t\x12\x16\n\x0eharness_config\x18\x05 \x01(\x0c\":\n\x0c\x45xecResponse\x12\x1c\n\x07outputs\x18\x01 \x03(\x0b\x32\x0b.ax.Message\x12\x0c\n\x04step\x18\x02 \x01(\x05\"4\n\x19\x44\x65leteConversationRequest\x12\x17\n\x0f\x63onversation_id\x18\x01 \x01(\t\"\x1c\n\x1a\x44\x65leteConversationResponse*l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rSTATE_PENDING\x10\x01\x12\x10\n\x0cSTATE_FAILED\x10\x02\x12\x13\n\x0fSTATE_COMPLETED\x10\x03\x12\x12\n\x0eSTATE_CANCELED\x10\x04*\x8c\x01\n\x0c\x43\x61ncelReason\x12\x1d\n\x19\x43\x41NCEL_REASON_UNSPECIFIED\x10\x00\x12 \n\x1c\x43\x41NCEL_REASON_USER_REQUESTED\x10\x01\x12\x19\n\x15\x43\x41NCEL_REASON_TIMEOUT\x10\x02\x12 \n\x1c\x43\x41NCEL_REASON_INTERNAL_ERROR\x10\x03\x32H\n\x0eHarnessService\x12\x36\n\x07\x43onnect\x12\x12.ax.HarnessRequest\x1a\x13.ax.HarnessResponse(\x01\x30\x01\x32?\n\x10\x45xecutionService\x12+\n\x04\x45xec\x12\x0f.ax.ExecRequest\x1a\x10.ax.ExecResponse0\x01\x32j\n\x13\x43onversationService\x12S\n\x12\x44\x65leteConversation\x12\x1d.ax.DeleteConversationRequest\x1a\x1e.ax.DeleteConversationResponseB\x1cZ\x1agithub.com/google/ax/protob\x06proto3')_globals = globals()_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)@@ -38,40 +24,40 @@ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.ax_pb2', _globals)if _descriptor._USE_C_DESCRIPTORS == False:_globals['DESCRIPTOR']._options = None_globals['DESCRIPTOR']._serialized_options = b'Z\032github.com/google/ax/proto'- _globals['_STATE']._serialized_start=1153- _globals['_STATE']._serialized_end=1261- _globals['_CANCELREASON']._serialized_start=1264- _globals['_CANCELREASON']._serialized_end=1404+ _globals['_STATE']._serialized_start=1156+ _globals['_STATE']._serialized_end=1264+ _globals['_CANCELREASON']._serialized_start=1267+ _globals['_CANCELREASON']._serialized_end=1407_globals['_MESSAGE']._serialized_start=73_globals['_MESSAGE']._serialized_end=126_globals['_CONVERSATIONEVENT']._serialized_start=129- _globals['_CONVERSATIONEVENT']._serialized_end=329- _globals['_HARNESSSTART']._serialized_start=331- _globals['_HARNESSSTART']._serialized_end=400- _globals['_HARNESSCANCEL']._serialized_start=402- _globals['_HARNESSCANCEL']._serialized_end=451- _globals['_HARNESSREQUEST']._serialized_start=454- _globals['_HARNESSREQUEST']._serialized_end=595- _globals['_HARNESSOUTPUTS']._serialized_start=597- _globals['_HARNESSOUTPUTS']._serialized_end=644- _globals['_ERROR']._serialized_start=646- _globals['_ERROR']._serialized_end=688- _globals['_HARNESSEND']._serialized_start=690- _globals['_HARNESSEND']._serialized_end=754- _globals['_HARNESSRESPONSE']._serialized_start=756- _globals['_HARNESSRESPONSE']._serialized_end=876- _globals['_EXECREQUEST']._serialized_start=879- _globals['_EXECREQUEST']._serialized_end=1008- _globals['_EXECRESPONSE']._serialized_start=1010- _globals['_EXECRESPONSE']._serialized_end=1067- _globals['_DELETECONVERSATIONREQUEST']._serialized_start=1069- _globals['_DELETECONVERSATIONREQUEST']._serialized_end=1121- _globals['_DELETECONVERSATIONRESPONSE']._serialized_start=1123- _globals['_DELETECONVERSATIONRESPONSE']._serialized_end=1151- _globals['_HARNESSSERVICE']._serialized_start=1406- _globals['_HARNESSSERVICE']._serialized_end=1478- _globals['_EXECUTIONSERVICE']._serialized_start=1480- _globals['_EXECUTIONSERVICE']._serialized_end=1543- _globals['_CONVERSATIONSERVICE']._serialized_start=1545- _globals['_CONVERSATIONSERVICE']._serialized_end=1651+ _globals['_CONVERSATIONEVENT']._serialized_end=330+ _globals['_HARNESSSTART']._serialized_start=332+ _globals['_HARNESSSTART']._serialized_end=401+ _globals['_HARNESSCANCEL']._serialized_start=403+ _globals['_HARNESSCANCEL']._serialized_end=452+ _globals['_HARNESSREQUEST']._serialized_start=455+ _globals['_HARNESSREQUEST']._serialized_end=596+ _globals['_HARNESSOUTPUTS']._serialized_start=598+ _globals['_HARNESSOUTPUTS']._serialized_end=645+ _globals['_ERROR']._serialized_start=647+ _globals['_ERROR']._serialized_end=689+ _globals['_HARNESSEND']._serialized_start=691+ _globals['_HARNESSEND']._serialized_end=755+ _globals['_HARNESSRESPONSE']._serialized_start=757+ _globals['_HARNESSRESPONSE']._serialized_end=877+ _globals['_EXECREQUEST']._serialized_start=880+ _globals['_EXECREQUEST']._serialized_end=1010+ _globals['_EXECRESPONSE']._serialized_start=1012+ _globals['_EXECRESPONSE']._serialized_end=1070+ _globals['_DELETECONVERSATIONREQUEST']._serialized_start=1072+ _globals['_DELETECONVERSATIONREQUEST']._serialized_end=1124+ _globals['_DELETECONVERSATIONRESPONSE']._serialized_start=1126+ _globals['_DELETECONVERSATIONRESPONSE']._serialized_end=1154+ _globals['_HARNESSSERVICE']._serialized_start=1409+ _globals['_HARNESSSERVICE']._serialized_end=1481+ _globals['_EXECUTIONSERVICE']._serialized_start=1483+ _globals['_EXECUTIONSERVICE']._serialized_end=1546+ _globals['_CONVERSATIONSERVICE']._serialized_start=1548+ _globals['_CONVERSATIONSERVICE']._serialized_end=1654# @@protoc_insertion_point(module_scope)diff --git a/python/proto/ax_pb2_grpc.py b/python/proto/ax_pb2_grpc.pyindex b35d953..df3140b 100644--- a/python/proto/ax_pb2_grpc.py+++ b/python/proto/ax_pb2_grpc.py@@ -1,17 +1,3 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!"""Client and server classes corresponding to protobuf-defined services."""import grpcdiff --git a/python/proto/content_pb2.py b/python/proto/content_pb2.pyindex c20ef7b..3f2bf3c 100644--- a/python/proto/content_pb2.py+++ b/python/proto/content_pb2.py@@ -1,17 +1,3 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.-# -*- coding: utf-8 -*-# Generated by the protocol buffer compiler. DO NOT EDIT!# source: proto/content.protodiff --git a/python/proto/content_pb2_grpc.py b/python/proto/content_pb2_grpc.pyindex fe9b2e7..2daafff 100644--- a/python/proto/content_pb2_grpc.py+++ b/python/proto/content_pb2_grpc.py@@ -1,17 +1,3 @@-# Copyright 2026 Google LLC-#-# Licensed under the Apache License, Version 2.0 (the "License");-# you may not use this file except in compliance with the License.-# You may obtain a copy of the License at-#-# http://www.apache.org/licenses/LICENSE-2.0-#-# Unless required by applicable law or agreed to in writing, software-# distributed under the License is distributed on an "AS IS" BASIS,-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-# See the License for the specific language governing permissions and-# limitations under the License.-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!"""Client and server classes corresponding to protobuf-defined services."""import grpc