Add high-level execute(code) helper for Python execution
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 8.7k
- Forks
- 1.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 253
Description
Motivation
OpenShell already exposes lower-level execution paths, but common Python code execution should be available through a small, ergonomic helper. A high-level execute(code) API would make the Python SDK easier to use for agent and notebook-style workflows without changing the underlying protocol.
Proposed change
Add a Python SDK method similar to:
result = sandbox.execute("print('hello from OpenShell')")
The helper should wrap the existing exec_python / exec path where appropriate, preserve the lower-level APIs, and return the same execution result information callers can inspect today.
Acceptance criteria
- Add a documented high-level
execute(code: str, ...)helper to the Python SDK. - Preserve existing lower-level execution APIs without breaking changes.
- Include unit tests for success, failure, timeout/error propagation, and result shape.
- Add a README or docs example showing simple Python execution.
Notes
This should be SDK-only and should not require gateway/proto changes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the Python SDK at the existing exec_python and exec paths to understand their result shape, error handling, and timeout behavior. Add the documented execute(code: str, ...) helper while preserving those lower-level APIs, then run or add unit tests for success, failure, timeout/error propagation, and result shape, and update the README or docs with a simple example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, documentation
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100