- Update default template from minimal to minimal-ubuntu
- Replace /root and /home/user paths with /home/wrenn-user in tests
- Update file ownership from root:root to wrenn-user:wrenn-user
- Add sudo-related integration tests
- Regenerate pydantic models from updated OpenAPI spec
- Add snapshotting status, AdminTemplate schema, protected field
- Rename Type1→Type5 enums to match new spec
- Update OpenAPI spec for async snapshot endpoints
Tests:
- tests/test_commands.py: unit coverage for Commands/AsyncCommands —
payload construction (cwd, envs, tag, timeout), background dispatch,
base64 response decoding, stream-event parsing, stream/connect iterators.
- tests/test_integration_advanced.py: live tests for cwd/env handling,
long-running commands (apt-get), PTY sessions, streaming exec,
process connect, and git workflows including cloning wrennhq/wrenn.
- test_filesystem_pty.py: PTY ping/pong reply tests.
- test_integration.py: poll for async process-registry prune in
test_kill_process instead of asserting on a zero-delay list().
Fixes:
- commands.py / pty.py: stream(), connect() and the PTY iterators only
caught WebSocketDisconnect. The server closes exec/process streams
abruptly, raising WebSocketNetworkError — a sibling under
HTTPXWSException — which crashed connect() entirely. Both are now
caught via _WS_CLOSED so abrupt closes end iteration cleanly.
- pty.py: reply to the server keepalive ping with a pong so idle PTY
sessions stay open.
Bugs fixed:
- files.py: use typed error checking (_raise_for_status) instead of raw
raise_for_status(), ensuring WrennNotFoundError etc. are raised
correctly
- exceptions.py: check both "capsule_ids" and "sandbox_ids" response
keys
for backwards compatibility
- code_interpreter: retry _ensure_kernel on 5xx errors (only fail on
4xx),
remove redundant TimeoutError in bare except, clean up non-standard
top-level msg_id/msg_type from Jupyter messages
Resource leaks fixed:
- capsule.py: close WrennClient if capsule creation or init fails
- code_interpreter: add close()/__del__ for _proxy_client cleanup when
not using context manager
Logic fixes:
- pty.py: yield exit events to callers instead of silently discarding
them
- capsule.py: auto-resume paused capsules in wait_ready instead of
failing
- capsule.py: log warnings on destroy failure in __exit__ instead of
silently swallowing errors
- Update Woodpecker to run unit and integration tests in parallel
- Add GitHub Actions workflow for PyPI trusted publishing on main
- Add license, classifiers, keywords, and URLs to pyproject.toml
- Fix ruff lint errors (unused imports, duplicate class name) and formatting
Replace the WrennClient-centric API with a top-level Capsule class that
mirrors e2b's Sandbox interface, enabling drop-in migration. Key changes:
- Capsule/AsyncCapsule with direct construction (reads WRENN_API_KEY and
WRENN_BASE_URL env vars), namespaced sub-objects (capsule.commands,
capsule.files), dual instance/static lifecycle methods via _DualMethod
descriptor (capsule.kill() and Capsule.kill(id))
- WrennClient simplified to API-key-only endpoints (capsules, snapshots);
JWT-based resources (auth, hosts, teams) removed
- wrenn.code_interpreter submodule with Capsule subclass defaulting to
code-runner-beta template and run_code() support
- Sandbox alias emits FutureWarning instead of DeprecationWarning
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add sandbox filesystem methods (list_dir, mkdir, remove, upload,
download, stream_upload, stream_download) and interactive PTY sessions
(PtySession, AsyncPtySession) with reconnect support per
FILE_TERMINAL.md spec. Refactor error handling into exceptions.py as
shared handle_response(). Replace API-key-only proxy auth with unified
_proxy_headers() supporting both API key and JWT. Fix stream_upload to
build multipart manually instead of relying on httpx files= with
generators. Switch Makefile SPEC_URL from main to dev branch. Regenerate
models from updated OpenAPI spec (adds teams, channels, metrics, PTY
endpoints). Add comprehensive unit and integration tests. Trim AGENTS.md
to verified facts only.