Skip to content

Conversation

@igooch
Copy link

@igooch igooch commented Feb 6, 2026

This PR introduces the infrastructure setup and examples required to run agent-sandbox for R2E-Gym rl training.

  • New Example Notebook: Added examples/deepswe/agent_sandbox_test.ipynb which demonstrates:
    • Setting up a GKE cluster with gVisor-enabled node pools.
    • Installing the agent-sandbox controller and client.
    • Interacting with the sandbox using R2E-Gym and a mock LLM loop.
  • Documentation: Updated examples/README.rst with instructions for creating and configuring a v5litepod-8 TPU VM in GCE.
  • Dependencies:
    • Pinned Python version to 3.12.9 in .python-version.
    • Updated uv.lock to reflect new dependencies required for the sandbox environment.
    • Updated .gitignore to exclude virtual environment directories (.venv).

@gemini-code-assist
Copy link

Summary of Changes

Hello @igooch, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the foundational infrastructure and a detailed example for integrating the agent-sandbox environment with R2E-Gym for reinforcement learning training. It provides a step-by-step guide within a new Jupyter notebook, covering GKE cluster provisioning with gVisor, agent-sandbox component installation, and a mock LLM interaction loop. Additionally, it updates existing documentation for TPU VM setup and refines project dependencies for a consistent development environment.

Highlights

  • Agent Sandbox Integration Example: Added a comprehensive Jupyter notebook (agent_sandbox_test.ipynb) demonstrating the full integration of agent-sandbox with R2E-Gym for RL training, including GKE setup, dependency management, and mock LLM interaction.
  • Documentation Update: Enhanced TPU VM setup documentation in examples/README.rst with explicit gcloud commands for creating and SSHing into a v5litepod-8 TPU VM.
  • Dependency Management: Pinned the project's Python version to 3.12.9 for consistency and improved virtual environment handling by adding **/.venv/ to .gitignore.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .gitignore
    • Added **/.venv/ to ignore virtual environment directories.
  • .python-version
    • Pinned Python version to 3.12.9.
  • examples/README.rst
    • Added explicit gcloud commands for creating a v5litepod-8 TPU VM.
    • Added explicit gcloud command for SSHing into the created TPU VM.
  • examples/deepswe/agent_sandbox_test.ipynb
    • Introduced a new Jupyter notebook demonstrating the integration of agent-sandbox with R2E-Gym.
    • Includes steps for GKE cluster setup with gVisor-enabled node pools.
    • Details the installation of the agent-sandbox controller and client.
    • Provides an example of interacting with the sandbox using R2E-Gym and a mock LLM loop.
    • Outlines dependency installation, including a specific R2E-Gym fork and the agentic-sandbox-client.
Activity
  • No human activity to report yet on this pull request.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a valuable example notebook for integrating agent-sandbox with R2E-Gym, complete with detailed setup instructions for GKE and dependencies. The changes to .gitignore and .python-version also improve project consistency. My review identifies a few issues in the new notebook that could prevent it from running correctly, such as an inconsistent node pool name and malformed mock data. There's also a minor style guide violation regarding exception handling. Addressing these points will make the example more robust and user-friendly.

"from kubernetes import client, config\n",
"import os\n",
"\n",
"NODE_POOL_NAME = \"gvisor-node-pool\"\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The NODE_POOL_NAME is hardcoded to "gvisor-node-pool", but the setup instructions in the markdown cell above (cell id: 26d4c4a6) define it as "gvisor-node-pool2". This inconsistency will cause the code to fail when selecting the node pool. To ensure the example works as described, this value should match the one in the setup instructions.

NODE_POOL_NAME = "gvisor-node-pool2"

" <function>\n",
" <parameter=command>search</parameter>\n",
" <parameter=search_term>initialize</parameter>\n",
" <parameter=path=/testbed</parameter>\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This mock response appears to be malformed. The format <parameter=path=/testbed</parameter> will be parsed incorrectly by the parse_action function, resulting in a key of 'path=/testbed' and an empty value. It should be <parameter=path>/testbed</parameter> to be parsed correctly as {'path': '/testbed'}. A similar issue exists on line 452.

    <parameter=path>/testbed</parameter>

" <function>\n",
" <parameter=command>search</parameter>\n",
" <parameter=search_term>migrate_context</parameter>\n",
" <parameter=path=/testbed</parameter>\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This mock response appears to be malformed. The format <parameter=path=/testbed</parameter> will be parsed incorrectly by the parse_action function, resulting in a key of 'path=/testbed' and an empty value. It should be <parameter=path>/testbed</parameter> to be parsed correctly as {'path': '/testbed'}.

    <parameter=path>/testbed</parameter>

Comment on lines +242 to +245
"try:\n",
" R2EGYM_PATH = os.path.dirname(r2egym.__file__)\n",
"except Exception:\n",
" R2EGYM_PATH = \"\"\n",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a broad except Exception: is discouraged by the style guide (line 91), which recommends using specific exceptions. In this case, the likely error is an AttributeError if r2egym.__file__ does not exist. Catching a more specific exception improves code clarity and avoids unintentionally catching other unrelated errors.

try:
    R2EGYM_PATH = os.path.dirname(r2egym.__file__)
except AttributeError:
    R2EGYM_PATH = ""
References
  1. Use specific exceptions: Avoid using broad exceptions like Exception. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant