-
Notifications
You must be signed in to change notification settings - Fork 237
Add Agent Sandbox integration example #1055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: deepswe-dev
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @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 Highlights
🧠 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
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this 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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
| "try:\n", | ||
| " R2EGYM_PATH = os.path.dirname(r2egym.__file__)\n", | ||
| "except Exception:\n", | ||
| " R2EGYM_PATH = \"\"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
- Use specific exceptions: Avoid using broad exceptions like
Exception. (link)
This PR introduces the infrastructure setup and examples required to run agent-sandbox for R2E-Gym rl training.