Feat: Agent Engine Sandbox Code Executor#317
Open
AmaadMartin wants to merge 14 commits into
Open
Conversation
d4384b4 to
fc2381f
Compare
fc2381f to
a740804
Compare
kalenkevich
reviewed
May 11, 2026
| data: file.content, // Assumed to be already base64 encoded based on CodeExecutionInput definition | ||
| metadata: { | ||
| attributes: { | ||
| file_name: Buffer.from(file.name).toString('base64'), |
Collaborator
There was a problem hiding this comment.
why do we need to encode that to base64?
Collaborator
Author
There was a problem hiding this comment.
The Vertex AI SDK expects Chunk objects for input which include base64 encoded data.
added 13 commits
May 11, 2026 15:35
…ions found in tests
- Update imports to use @google-cloud/vertexai root instead of deep paths. - Move regex patterns to file level as constants. - Remove explicit type cast in favor of type inference. - Change operational log levels from info to debug. - Add @experimental decorator to AgentEngineSandboxCodeExecutor. - Update test file to import from @google/adk instead of relative path.
… session state parity
6461335 to
f969164
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Issue or Description of Change
If no issue exists, describe the change:
Ported
agent_engine_sandbox_code_executorfromadk-pythontoadk-jsto support executing code generated by agents in a secure sandbox environment using Vertex AI.Problem: Need to support executing code generated by agents in a secure sandbox environment using Vertex AI in the JS SDK, matching the feature available in the Python SDK.
Solution: Implemented
AgentEngineSandboxCodeExecutorin TypeScript, leveraging@google-cloud/vertexai's API for sandbox management and code execution. The implementation handles session state to reuse sandboxes when possible and falls back to creating new ones if needed or expired.Testing Plan
Please describe the tests that you ran to verify your changes. This is required for all PRs that are not small documentation or typo fixes.
Unit Tests:
Summary of passed tests:
core/test/code_executors/agent_engine_sandbox_code_executor_test.ts.agent_engine_sandbox_code_executor.ts(based on coverage report showing 100% for the file in thecode_executorsdirectory).Manual End-to-End (E2E) Tests:
tests/integration/agents/agent_with_sandbox_executor_test.tswhich verifies the integration of the executor with an LLM agent.Checklist
Additional context
This depends on the Agent Engine Session Service PR