Skip to content

fix(sandbox): add sandbox delete/stop/get passthrough config#63

Merged
OhYee merged 1 commit intomainfrom
sandbox-delete-stop-headers
Mar 6, 2026
Merged

fix(sandbox): add sandbox delete/stop/get passthrough config#63
OhYee merged 1 commit intomainfrom
sandbox-delete-stop-headers

Conversation

@Sodawyx
Copy link
Collaborator

@Sodawyx Sodawyx commented Mar 6, 2026

add sandbox delete/stop/get passthrough configurations

Co-developed-by: Aone Copilot noreply@alibaba-inc.com

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

add sandbox delete/stop/get passthrough configurations

Co-developed-by: Aone Copilot <noreply@alibaba-inc.com>
Signed-off-by: Sodawyx <sodawyx@126.com>
Copy link
Contributor

Copilot AI left a 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 adds config (Config object) passthrough support to the sandbox delete, stop, and get operations in the high-level Sandbox API. Previously these methods ignored any user-provided config object, making them inconsistent with methods like create() that already supported config passthrough.

Changes:

  • Sandbox.stop_by_id, Sandbox.stop_by_id_async, Sandbox.delete_by_id, and Sandbox.delete_by_id_async class methods now accept an optional config parameter and forward it to the underlying API client
  • Instance methods stop(), stop_async(), delete(), delete_async(), get(), and get_async() now forward self._config when calling their underlying class methods or connect()/connect_async(); create() and create_async() now also pass config to create_sandbox/create_sandbox_async
  • New TestSandboxConfigPassthrough test class added to verify config is properly forwarded for all affected operations

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
agentrun/sandbox/sandbox.py Adds config param to stop_by_id* and delete_by_id* class methods; passes self._config through all relevant instance methods
agentrun/sandbox/__sandbox_async_template.py Mirrors sandbox.py changes for the async template (source for codegen)
tests/unittests/sandbox/test_sandbox.py New TestSandboxConfigPassthrough class with 12 tests covering config passthrough for stop, delete, get, and create operations, both sync and async

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@OhYee OhYee merged commit 7b9a8f3 into main Mar 6, 2026
6 checks passed
@OhYee OhYee deleted the sandbox-delete-stop-headers branch March 6, 2026 09:29
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.

3 participants