-
Notifications
You must be signed in to change notification settings - Fork 5
update sandbox pool doc #8
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
Conversation
Summary of ChangesHello @Yunnglin, 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 primarily focuses on significantly enhancing the documentation for sandbox management, making it easier for users to understand and utilize advanced features. It introduces a new Highlights
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 documentation for the new SandboxManagerFactory and Sandbox Pool features, which is a valuable addition. The examples provided are clear and helpful. I've identified a few areas for improvement in the code and tests to enhance correctness and maintainability. Specifically, there's an incorrect docstring, a hardcoded magic number that should be a constant, and a bug in a test assertion. Addressing these points will strengthen the implementation.
| @@ -372,7 +372,6 @@ async def execute_tool_in_pool( | |||
| Args: | |||
| tool_name: Tool name to execute | |||
| parameters: Tool parameters | |||
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 timeout parameter was removed from the docstring, but it is still part of the function signature and is used within the method. To maintain documentation accuracy and prevent confusion, the timeout parameter should be documented in the docstring.
| parameters: Tool parameters | |
| parameters: Tool parameters | |
| timeout: Optional timeout for waiting for available sandbox |
| raise RuntimeError('Sandbox manager not started') | ||
|
|
||
| timeout = timeout or self.config.timeout | ||
| timeout = timeout or self.config.timeout or 60 * 60 # Default 60 minutes |
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 default timeout of 60 * 60 is a magic number. For better readability and maintainability, consider defining this as a named constant at the module level, for example:
DEFAULT_POOL_EXECUTION_TIMEOUT = 3600 # 1 hourThen you could use it here:
timeout = timeout or self.config.timeout or DEFAULT_POOL_EXECUTION_TIMEOUTThere 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.
Pull request overview
This PR updates the sandbox pool documentation by adding comprehensive Chinese and English documentation for the SandboxManagerFactory and sandbox pool features. The changes also include a minor test update and a code improvement to the timeout handling.
Key changes:
- Added documentation for SandboxManagerFactory (automatic manager type selection)
- Added detailed sandbox pool usage examples in both English and Chinese READMEs
- Updated concurrent pool test to use 5 tasks instead of 3
- Improved timeout default handling with a 60-minute fallback
- Removed outdated timeout parameter from docstring
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Added section 0 for SandboxManagerFactory and section 4 for sandbox pool with local/HTTP examples and configuration notes |
| README_zh.md | Added Chinese translations of the same SandboxManagerFactory and sandbox pool documentation |
| ms_enclave/sandbox/manager/local_manager.py | Removed timeout parameter from docstring and added 60-minute default timeout fallback |
| tests/test_manage_pool.py | Increased concurrent test tasks from 3 to 5 to better test pool queuing behavior |
| Args: | ||
| tool_name: Tool name to execute | ||
| parameters: Tool parameters |
Copilot
AI
Dec 15, 2025
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 timeout parameter was removed from the docstring but it still exists in the function signature at line 364. The docstring should document this parameter. It represents the maximum time to wait for an available sandbox from the pool before raising a TimeoutError.
No description provided.