diff --git a/.github/workflows/check-binaries.yml b/.github/workflows/check-binaries.yml new file mode 100644 index 00000000..c06b7fae --- /dev/null +++ b/.github/workflows/check-binaries.yml @@ -0,0 +1,39 @@ +# 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. + +name: Check Binaries + +on: + pull_request: + branches: [ "main" ] + +jobs: + check-no-binaries: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for binary files in PR + run: | + git fetch origin ${{ github.base_ref }} + BINARIES=$(git diff --numstat --diff-filter=ACM origin/${{ github.base_ref }}...HEAD | awk '$1 == "-" || $2 == "-" {print $3}') + + if [ -n "$BINARIES" ]; then + echo "::error::Binary files are not allowed to be committed in PRs. Found:" + echo "$BINARIES" + exit 1 + fi diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 3fd354fc..9130a0d3 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -60,14 +60,3 @@ jobs: - name: Test run: go test -v ./... - - - name: Check for binary files in PR - run: | - # Get the list of files where Git shows no line count (binary) - BINARIES=$(git diff --numstat origin/${{ github.base_ref }}...HEAD | grep "^-" | cut -f3) - - if [ -n "$BINARIES" ]; then - echo "Binary files detected in diff:" - echo "$BINARIES" - exit 1 # Fail the check if binaries are found - fi diff --git a/.gitignore b/.gitignore index dbf71d34..fa40af35 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,4 @@ ax-bin python/__pycache__ python/proto/__pycache__ __pycache__/ - -# accidental upstream binary (#329) -/e2e +e2e diff --git a/cmd/ax/harness.go b/cmd/ax/harness.go index 5d7e5e56..5c3541e4 100644 --- a/cmd/ax/harness.go +++ b/cmd/ax/harness.go @@ -180,16 +180,16 @@ func runAntigravityInteractionsHarness(ctx context.Context) error { return err } - // The process was chdir'd to AX_HARNESS_WORKDIR by setHarnessWorkDir (and the - // interactions executor re-applies it per turn). Tell the agent so it emits - // paths relative to the workspace rather than the process root "/". + // WorkDir is the agent's working directory. It is authoritative for built-in + // env tools (see AntigravityInteractionsConfig.WorkDir) so their execution + // does not depend on the process cwd. Empty falls back to the process cwd. + workDir := os.Getenv("AX_HARNESS_WORKDIR") + cfg := antigravityinteractions.AntigravityInteractionsConfig{ - Agent: agent, - StateDir: stateDir, - SystemInstruction: antigravityinteractions.JoinSystemInstruction( - hc.SystemInstruction, - antigravityinteractions.WorkspaceSystemInstruction(os.Getenv("AX_HARNESS_WORKDIR")), - ), + Agent: agent, + StateDir: stateDir, + WorkDir: workDir, + SystemInstruction: antigravityinteractions.JoinSystemInstruction(hc.SystemInstruction, antigravityinteractions.WorkspaceSystemInstruction(workDir)), } return antigravityinteractions.Serve(ctx, cfg, harnessHost, harnessPort, harnessReadyzPort) } diff --git a/cmd/ax/internal/cliutil/cliutil.go b/cmd/ax/internal/cliutil/cliutil.go index 67423efe..296820f2 100644 --- a/cmd/ax/internal/cliutil/cliutil.go +++ b/cmd/ax/internal/cliutil/cliutil.go @@ -131,18 +131,23 @@ func NewControllerFromConfig(ctx context.Context, cfg *Config) (*controller.Cont if sErr != nil { return nil, fmt.Errorf("antigravity-interactions harness: %w", sErr) } + // WorkDir is the agent's working directory, authoritative for built-in env + // tools (see AntigravityInteractionsConfig.WorkDir). Mirrors the substrate + // path (cmd/ax harness): sourced from AX_HARNESS_WORKDIR, empty falls back + // to the process cwd. + workDir := os.Getenv("AX_HARNESS_WORKDIR") // skillsPointer was built once, up front, from the top-level skills // config (see above). Append it, plus the workspace pointer, to any - // configured system instruction. The workspace pointer tells the agent - // its working directory (AX_HARNESS_WORKDIR) so it emits sensible paths. + // configured system instruction. systemInstruction := antigravityinteractions.JoinSystemInstruction( antigravityinteractions.JoinSystemInstruction(aiCfg.SystemInstruction, skillsPointer), - antigravityinteractions.WorkspaceSystemInstruction(os.Getenv("AX_HARNESS_WORKDIR")), + antigravityinteractions.WorkspaceSystemInstruction(workDir), ) antigravityInteractionsHarness, err = antigravityinteractions.New(antigravityinteractions.AntigravityInteractionsConfig{ Agent: agent, SystemInstruction: systemInstruction, StateDir: stateDir, + WorkDir: workDir, }) } else { antigravityInteractionsHarness, err = substrate.New(config.AntigravityInteractionsHarnessID, "", "", config.AntigravityInteractionsTemplate, 80) diff --git a/internal/harness/antigravityinteractions/antigravityinteractions.go b/internal/harness/antigravityinteractions/antigravityinteractions.go index 56c9f3fb..ce9cc00d 100644 --- a/internal/harness/antigravityinteractions/antigravityinteractions.go +++ b/internal/harness/antigravityinteractions/antigravityinteractions.go @@ -116,6 +116,13 @@ type AntigravityInteractionsConfig struct { // --- Optional --- + // WorkDir is the working directory the agent operates in. When set, it is the + // authoritative base for built-in env tools: run_command executes there (and + // resolves a relative Cwd against it). This makes tool execution independent + // of the process's ambient cwd. Empty means "use the process cwd" (the + // previous behavior). Defaults from AX_HARNESS_WORKDIR. + WorkDir string + // SystemInstruction, if set, is sent as the interaction's system_instruction // (a free-form system prompt prepended to the agent's own instructions). It // is sent on every turn of the interaction loop so it persists across them. @@ -143,6 +150,9 @@ func (c *AntigravityInteractionsConfig) withDefaults() { if c.MaxTurns == 0 { c.MaxTurns = 100 } + if c.WorkDir == "" { + c.WorkDir = os.Getenv("AX_HARNESS_WORKDIR") + } } // cloudProject returns the Cloud project id from GOOGLE_CLOUD_PROJECT. diff --git a/internal/harness/antigravityinteractions/antigravityinteractions_tools.go b/internal/harness/antigravityinteractions/antigravityinteractions_tools.go index ad4b979f..d3541c0a 100644 --- a/internal/harness/antigravityinteractions/antigravityinteractions_tools.go +++ b/internal/harness/antigravityinteractions/antigravityinteractions_tools.go @@ -44,7 +44,7 @@ func (h *AntigravityInteractionsHarness) executeTool(ctx context.Context, call c case "view_file": return execViewFile(call) case "run_command": - return execRunCommand(ctx, call) + return execRunCommand(ctx, call, h.cfg.WorkDir) case "list_dir", "list_directory": return execListDir(call) case "move": @@ -229,7 +229,7 @@ func applyByteWindow(content string, offset int) string { // command (e.g. `find /`, or `ping` without a count) cannot wedge the harness. const runCommandTimeout = 60 * time.Second -func execRunCommand(ctx context.Context, call capturedToolCall) any { +func execRunCommand(ctx context.Context, call capturedToolCall, workDir string) any { cmdLine := stringArg(call.arguments, "CommandLine") if cmdLine == "" { return map[string]any{"error": "run_command: missing required argument 'CommandLine'"} @@ -240,9 +240,11 @@ func execRunCommand(ctx context.Context, call capturedToolCall) any { defer cancel() cmd := exec.CommandContext(runCtx, "/bin/sh", "-c", cmdLine) - if cwd := stringArg(call.arguments, "Cwd"); cwd != "" { - cmd.Dir = cwd - } + // Resolve the working directory. workDir is authoritative so execution does + // not depend on the process's ambient cwd. A model-supplied Cwd is honored + // relative to workDir if relative, or as-is if absolute; without one, the + // command runs in workDir. + cmd.Dir = resolveRunDir(workDir, stringArg(call.arguments, "Cwd")) out, err := cmd.CombinedOutput() @@ -266,6 +268,28 @@ func execRunCommand(ctx context.Context, call capturedToolCall) any { return map[string]any{"Output": string(out), "ExitCode": exitCode} } +// resolveRunDir picks the directory run_command executes in. +// +// - No cwd arg: run in workDir (or the process cwd if workDir is empty). +// - Absolute cwd: honored as-is (the agent asked for a specific location). +// - Relative cwd: resolved against workDir, keeping the agent scoped to its +// workspace rather than the process's ambient cwd. +// +// Returning "" makes exec use the process's current directory, matching the +// prior behavior when no working directory is configured. +func resolveRunDir(workDir, cwd string) string { + switch { + case cwd == "": + return workDir + case filepath.IsAbs(cwd): + return cwd + case workDir == "": + return cwd + default: + return filepath.Join(workDir, cwd) + } +} + func execListDir(call capturedToolCall) any { dir := stringArg(call.arguments, "DirectoryPath") if dir == "" { diff --git a/internal/harness/antigravityinteractions/antigravityinteractions_tools_test.go b/internal/harness/antigravityinteractions/antigravityinteractions_tools_test.go index e38f3a36..38bc9ce7 100644 --- a/internal/harness/antigravityinteractions/antigravityinteractions_tools_test.go +++ b/internal/harness/antigravityinteractions/antigravityinteractions_tools_test.go @@ -15,6 +15,7 @@ package antigravityinteractions import ( + "context" "fmt" "os" "path/filepath" @@ -341,3 +342,84 @@ func TestIntArgOK(t *testing.T) { } } } + +func TestResolveRunDir(t *testing.T) { + cases := []struct { + name string + workDir string + cwd string + want string + }{ + {"no cwd -> workDir", "/workspace", "", "/workspace"}, + {"relative cwd joined to workDir", "/workspace", "sub/dir", "/workspace/sub/dir"}, + {"absolute cwd honored as-is", "/workspace", "/etc", "/etc"}, + {"no workDir, no cwd -> empty (process cwd)", "", "", ""}, + {"no workDir, relative cwd -> cwd", "", "sub", "sub"}, + {"no workDir, absolute cwd -> cwd", "", "/etc", "/etc"}, + } + for _, c := range cases { + if got := resolveRunDir(c.workDir, c.cwd); got != c.want { + t.Errorf("%s: resolveRunDir(%q,%q) = %q, want %q", c.name, c.workDir, c.cwd, got, c.want) + } + } +} + +func TestExecRunCommand_RunsInWorkDir(t *testing.T) { + // Create a workspace with a marker file; `ls` from workDir (no Cwd arg) must + // list it, proving execution is scoped to workDir and not the process cwd. + work := t.TempDir() + if err := os.WriteFile(filepath.Join(work, "marker.txt"), []byte("x"), 0o644); err != nil { + t.Fatal(err) + } + + t.Run("no cwd runs in workDir", func(t *testing.T) { + res := execRunCommand(context.Background(), + capturedToolCall{arguments: map[string]any{"CommandLine": "ls"}}, + work).(map[string]any) + if code := res["ExitCode"]; code != 0 { + t.Fatalf("ExitCode = %v, want 0 (output: %v)", code, res["Output"]) + } + if out, _ := res["Output"].(string); !strings.Contains(out, "marker.txt") { + t.Errorf("Output = %q, want it to list marker.txt (ran in wrong dir)", out) + } + }) + + t.Run("pwd reports workDir", func(t *testing.T) { + res := execRunCommand(context.Background(), + capturedToolCall{arguments: map[string]any{"CommandLine": "pwd"}}, + work).(map[string]any) + out, _ := res["Output"].(string) + // macOS /tmp is a symlink to /private/tmp, so compare by suffix/resolved. + if got := strings.TrimSpace(out); got != work && !strings.HasSuffix(got, work) { + resolved, _ := filepath.EvalSymlinks(work) + if got != resolved { + t.Errorf("pwd = %q, want %q", got, work) + } + } + }) + + t.Run("relative cwd resolves under workDir", func(t *testing.T) { + if err := os.Mkdir(filepath.Join(work, "sub"), 0o755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(filepath.Join(work, "sub", "inner.txt"), []byte("y"), 0o644); err != nil { + t.Fatal(err) + } + res := execRunCommand(context.Background(), + capturedToolCall{arguments: map[string]any{"CommandLine": "ls", "Cwd": "sub"}}, + work).(map[string]any) + if out, _ := res["Output"].(string); !strings.Contains(out, "inner.txt") { + t.Errorf("Output = %q, want it to list inner.txt (relative Cwd not resolved under workDir)", out) + } + }) +} + +func TestWorkspaceSystemInstruction(t *testing.T) { + if got := WorkspaceSystemInstruction(""); got != "" { + t.Errorf("empty workDir = %q, want empty", got) + } + got := WorkspaceSystemInstruction("/workspace") + if !strings.Contains(got, "/workspace") { + t.Errorf("instruction = %q, want it to mention the working directory", got) + } +} diff --git a/internal/harness/antigravityinteractions/workspace.go b/internal/harness/antigravityinteractions/workspace.go index 84ef4102..744f0165 100644 --- a/internal/harness/antigravityinteractions/workspace.go +++ b/internal/harness/antigravityinteractions/workspace.go @@ -22,11 +22,11 @@ import ( // WorkspaceSystemInstruction builds a system-instruction snippet that orients // the agent about its working directory. // -// This complements the harness making the working directory authoritative for -// execution (the process is chdir'd to AX_HARNESS_WORKDIR, and the interactions -// executor re-applies it per turn): the chdir guarantees commands run in the -// right place, while this tells the agent so it emits sensible paths (relative -// to the workspace, not the process root "/"). Returns "" when workDir is empty. +// This complements the executor making WorkDir authoritative (see +// AntigravityInteractionsConfig.WorkDir): the executor guarantees commands run +// in the right place, while this tells the agent so it emits sensible paths +// (relative to the workspace, not the process root "/"). Returns "" when +// workDir is empty. func WorkspaceSystemInstruction(workDir string) string { if strings.TrimSpace(workDir) == "" { return "" diff --git a/internal/harness/antigravityinteractions/workspace_test.go b/internal/harness/antigravityinteractions/workspace_test.go deleted file mode 100644 index 6a176308..00000000 --- a/internal/harness/antigravityinteractions/workspace_test.go +++ /dev/null @@ -1,53 +0,0 @@ -// 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. - -package antigravityinteractions - -import "testing" - -func TestWorkspaceSystemInstruction(t *testing.T) { - t.Run("empty returns empty", func(t *testing.T) { - for _, in := range []string{"", " ", "\t\n"} { - if got := WorkspaceSystemInstruction(in); got != "" { - t.Errorf("WorkspaceSystemInstruction(%q) = %q, want empty", in, got) - } - } - }) - - t.Run("names the working directory", func(t *testing.T) { - got := WorkspaceSystemInstruction("/durable/work") - if got == "" { - t.Fatal("WorkspaceSystemInstruction(/durable/work) = empty, want a snippet") - } - if want := "/durable/work"; !contains(got, want) { - t.Errorf("WorkspaceSystemInstruction(%q) = %q, want it to mention %q", "/durable/work", got, want) - } - }) - - t.Run("joins cleanly as a system-instruction pointer", func(t *testing.T) { - // Empty workDir must not add a stray separator to an existing instruction. - if got := JoinSystemInstruction("base", WorkspaceSystemInstruction("")); got != "base" { - t.Errorf("JoinSystemInstruction with empty workspace = %q, want %q", got, "base") - } - }) -} - -func contains(s, sub string) bool { - for i := 0; i+len(sub) <= len(s); i++ { - if s[i:i+len(sub)] == sub { - return true - } - } - return false -} diff --git a/proto/ax.pb.go b/proto/ax.pb.go index beba3025..2be18ae9 100644 --- a/proto/ax.pb.go +++ b/proto/ax.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.3 +// protoc v5.28.2 // source: proto/ax.proto package proto diff --git a/proto/ax_grpc.pb.go b/proto/ax_grpc.pb.go index 2aebd64a..dc1e0b81 100644 --- a/proto/ax_grpc.pb.go +++ b/proto/ax_grpc.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.6.2 -// - protoc v4.25.3 +// - protoc-gen-go-grpc v1.5.1 +// - protoc v5.28.2 // source: proto/ax.proto package proto @@ -88,7 +88,7 @@ type HarnessServiceServer interface { type UnimplementedHarnessServiceServer struct{} func (UnimplementedHarnessServiceServer) Connect(grpc.BidiStreamingServer[HarnessRequest, HarnessResponse]) error { - return status.Error(codes.Unimplemented, "method Connect not implemented") + return status.Errorf(codes.Unimplemented, "method Connect not implemented") } func (UnimplementedHarnessServiceServer) mustEmbedUnimplementedHarnessServiceServer() {} func (UnimplementedHarnessServiceServer) testEmbeddedByValue() {} @@ -101,7 +101,7 @@ type UnsafeHarnessServiceServer interface { } func RegisterHarnessServiceServer(s grpc.ServiceRegistrar, srv HarnessServiceServer) { - // If the following call panics, it indicates UnimplementedHarnessServiceServer was + // If the following call pancis, it indicates UnimplementedHarnessServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. @@ -194,7 +194,7 @@ type ExecutionServiceServer interface { type UnimplementedExecutionServiceServer struct{} func (UnimplementedExecutionServiceServer) Exec(*ExecRequest, grpc.ServerStreamingServer[ExecResponse]) error { - return status.Error(codes.Unimplemented, "method Exec not implemented") + return status.Errorf(codes.Unimplemented, "method Exec not implemented") } func (UnimplementedExecutionServiceServer) mustEmbedUnimplementedExecutionServiceServer() {} func (UnimplementedExecutionServiceServer) testEmbeddedByValue() {} @@ -207,7 +207,7 @@ type UnsafeExecutionServiceServer interface { } func RegisterExecutionServiceServer(s grpc.ServiceRegistrar, srv ExecutionServiceServer) { - // If the following call panics, it indicates UnimplementedExecutionServiceServer was + // If the following call pancis, it indicates UnimplementedExecutionServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. @@ -294,7 +294,7 @@ type ConversationServiceServer interface { type UnimplementedConversationServiceServer struct{} func (UnimplementedConversationServiceServer) DeleteConversation(context.Context, *DeleteConversationRequest) (*DeleteConversationResponse, error) { - return nil, status.Error(codes.Unimplemented, "method DeleteConversation not implemented") + return nil, status.Errorf(codes.Unimplemented, "method DeleteConversation not implemented") } func (UnimplementedConversationServiceServer) mustEmbedUnimplementedConversationServiceServer() {} func (UnimplementedConversationServiceServer) testEmbeddedByValue() {} @@ -307,7 +307,7 @@ type UnsafeConversationServiceServer interface { } func RegisterConversationServiceServer(s grpc.ServiceRegistrar, srv ConversationServiceServer) { - // If the following call panics, it indicates UnimplementedConversationServiceServer was + // If the following call pancis, it indicates UnimplementedConversationServiceServer was // embedded by pointer and is nil. This will cause panics if an // unimplemented method is ever invoked, so we test this at initialization // time to prevent it from happening at runtime later due to I/O. diff --git a/proto/content.pb.go b/proto/content.pb.go index 70cdabcd..1cae4f60 100644 --- a/proto/content.pb.go +++ b/proto/content.pb.go @@ -15,7 +15,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.36.11 -// protoc v4.25.3 +// protoc v5.28.2 // source: proto/content.proto package proto diff --git a/python/proto/ax_pb2.py b/python/proto/ax_pb2.py index 2386fb36..a2f5b52d 100644 --- a/python/proto/ax_pb2.py +++ b/python/proto/ax_pb2.py @@ -1,22 +1,26 @@ +# 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 +# +# https://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! -# NO CHECKED-IN PROTOBUF GENCODE # source: proto/ax.proto -# Protobuf Python Version: 5.29.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 5, - 29, - 0, - '', - 'proto/ax.proto' -) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -31,8 +35,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.ax_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None +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=1234 _globals['_STATE']._serialized_end=1342 diff --git a/python/proto/ax_pb2_grpc.py b/python/proto/ax_pb2_grpc.py index b2564e05..78d74565 100644 --- a/python/proto/ax_pb2_grpc.py +++ b/python/proto/ax_pb2_grpc.py @@ -1,29 +1,23 @@ +# 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 +# +# https://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 -import warnings from proto import ax_pb2 as proto_dot_ax__pb2 -GRPC_GENERATED_VERSION = '1.70.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True - -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in proto/ax_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - ) - class HarnessServiceStub(object): """Missing associated documentation comment in .proto file.""" @@ -38,7 +32,7 @@ def __init__(self, channel): '/ax.HarnessService/Connect', request_serializer=proto_dot_ax__pb2.HarnessRequest.SerializeToString, response_deserializer=proto_dot_ax__pb2.HarnessResponse.FromString, - _registered_method=True) + ) class HarnessServiceServicer(object): @@ -66,7 +60,6 @@ def add_HarnessServiceServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'ax.HarnessService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('ax.HarnessService', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -84,21 +77,11 @@ def Connect(request_iterator, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.stream_stream( - request_iterator, - target, - '/ax.HarnessService/Connect', + return grpc.experimental.stream_stream(request_iterator, target, '/ax.HarnessService/Connect', proto_dot_ax__pb2.HarnessRequest.SerializeToString, proto_dot_ax__pb2.HarnessResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class ExecutionServiceStub(object): @@ -114,7 +97,7 @@ def __init__(self, channel): '/ax.ExecutionService/Exec', request_serializer=proto_dot_ax__pb2.ExecRequest.SerializeToString, response_deserializer=proto_dot_ax__pb2.ExecResponse.FromString, - _registered_method=True) + ) class ExecutionServiceServicer(object): @@ -140,7 +123,6 @@ def add_ExecutionServiceServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'ax.ExecutionService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('ax.ExecutionService', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -158,21 +140,11 @@ def Exec(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream( - request, - target, - '/ax.ExecutionService/Exec', + return grpc.experimental.unary_stream(request, target, '/ax.ExecutionService/Exec', proto_dot_ax__pb2.ExecRequest.SerializeToString, proto_dot_ax__pb2.ExecResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) class ConversationServiceStub(object): @@ -188,7 +160,7 @@ def __init__(self, channel): '/ax.ConversationService/DeleteConversation', request_serializer=proto_dot_ax__pb2.DeleteConversationRequest.SerializeToString, response_deserializer=proto_dot_ax__pb2.DeleteConversationResponse.FromString, - _registered_method=True) + ) class ConversationServiceServicer(object): @@ -214,7 +186,6 @@ def add_ConversationServiceServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'ax.ConversationService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) - server.add_registered_method_handlers('ax.ConversationService', rpc_method_handlers) # This class is part of an EXPERIMENTAL API. @@ -232,18 +203,8 @@ def DeleteConversation(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary( - request, - target, - '/ax.ConversationService/DeleteConversation', + return grpc.experimental.unary_unary(request, target, '/ax.ConversationService/DeleteConversation', proto_dot_ax__pb2.DeleteConversationRequest.SerializeToString, proto_dot_ax__pb2.DeleteConversationResponse.FromString, - options, - channel_credentials, - insecure, - call_credentials, - compression, - wait_for_ready, - timeout, - metadata, - _registered_method=True) + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/python/proto/content_pb2.py b/python/proto/content_pb2.py index 049297ae..c7439ff5 100644 --- a/python/proto/content_pb2.py +++ b/python/proto/content_pb2.py @@ -1,22 +1,26 @@ +# 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 +# +# https://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! -# NO CHECKED-IN PROTOBUF GENCODE # source: proto/content.proto -# Protobuf Python Version: 5.29.0 +# Protobuf Python Version: 4.25.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 5, - 29, - 0, - '', - 'proto/content.proto' -) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -30,8 +34,8 @@ _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.content_pb2', _globals) -if not _descriptor._USE_C_DESCRIPTORS: - _globals['DESCRIPTOR']._loaded_options = None +if _descriptor._USE_C_DESCRIPTORS == False: + _globals['DESCRIPTOR']._options = None _globals['DESCRIPTOR']._serialized_options = b'Z\032github.com/google/ax/proto' _globals['_MEDIARESOLUTION']._serialized_start=2638 _globals['_MEDIARESOLUTION']._serialized_end=2736 diff --git a/python/proto/content_pb2_grpc.py b/python/proto/content_pb2_grpc.py index 3b145290..0a3290b2 100644 --- a/python/proto/content_pb2_grpc.py +++ b/python/proto/content_pb2_grpc.py @@ -1,24 +1,18 @@ +# 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 +# +# https://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 -import warnings - - -GRPC_GENERATED_VERSION = '1.70.0' -GRPC_VERSION = grpc.__version__ -_version_not_supported = False - -try: - from grpc._utilities import first_version_is_lower - _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION) -except ImportError: - _version_not_supported = True -if _version_not_supported: - raise RuntimeError( - f'The grpc package installed is at version {GRPC_VERSION},' - + f' but the generated code in proto/content_pb2_grpc.py depends on' - + f' grpcio>={GRPC_GENERATED_VERSION}.' - + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' - + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' - )